From 3b35958a8627e2cb975e9df4334cef13b2554110 Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 17 Aug 2023 20:36:14 +0300 Subject: [PATCH 01/31] wip: add rust sdk generation --- .vscode/settings.json | 1 + clients/rust/Cargo.lock | 5558 +++++++++++++++++ clients/rust/Cargo.toml | 27 + .../accounts/collection_authority_record.rs | 53 + .../rust/src/generated/accounts/edition.rs | 22 + .../src/generated/accounts/edition_marker.rs | 51 + .../generated/accounts/edition_marker_v2.rs | 16 + .../src/generated/accounts/master_edition.rs | 49 + .../rust/src/generated/accounts/metadata.rs | 66 + .../accounts/metadata_delegate_record.rs | 64 + clients/rust/src/generated/accounts/mod.rs | 28 + .../generated/accounts/token_owned_escrow.rs | 20 + .../src/generated/accounts/token_record.rs | 58 + .../accounts/use_authority_record.rs | 52 + clients/rust/src/generated/errors/mod.rs | 10 + .../generated/errors/mpl_token_metadata.rs | 591 ++ .../approve_collection_authority.rs | 387 ++ .../instructions/approve_use_authority.rs | 497 ++ .../bubblegum_set_collection_size.rs | 350 ++ .../instructions/burn_edition_nft.rs | 477 ++ .../src/generated/instructions/burn_nft.rs | 357 ++ .../src/generated/instructions/burn_v1.rs | 672 ++ .../instructions/close_escrow_account.rs | 365 ++ .../src/generated/instructions/collect.rs | 180 + .../convert_master_edition_v1_to_v2.rs | 216 + .../instructions/create_escrow_account.rs | 410 ++ .../instructions/create_master_edition_v3.rs | 429 ++ .../create_metadata_account_v3.rs | 407 ++ .../src/generated/instructions/create_v1.rs | 680 ++ .../delegate_authority_item_v1.rs | 657 ++ .../delegate_collection_item_v1.rs | 657 ++ .../instructions/delegate_collection_v1.rs | 657 ++ .../instructions/delegate_data_item_v1.rs | 657 ++ .../instructions/delegate_data_v1.rs | 657 ++ .../delegate_locked_transfer_v1.rs | 688 ++ .../delegate_programmable_config_item_v1.rs | 657 ++ .../delegate_programmable_config_v1.rs | 657 ++ .../instructions/delegate_sale_v1.rs | 652 ++ .../instructions/delegate_staking_v1.rs | 652 ++ .../instructions/delegate_standard_v1.rs | 643 ++ .../instructions/delegate_transfer_v1.rs | 652 ++ .../instructions/delegate_utility_v1.rs | 652 ++ ..._from_master_edition_via_printing_token.rs | 656 ++ .../instructions/freeze_delegated_account.rs | 271 + .../src/generated/instructions/lock_v1.rs | 605 ++ .../src/generated/instructions/migrate.rs | 629 ++ ...w_edition_from_master_edition_via_token.rs | 642 ++ ...ion_from_master_edition_via_vault_proxy.rs | 747 +++ .../src/generated/instructions/mint_v1.rs | 700 +++ .../rust/src/generated/instructions/mod.rs | 172 + .../src/generated/instructions/print_v1.rs | 801 +++ .../generated/instructions/puff_metadata.rs | 147 + .../remove_creator_verification.rs | 177 + .../instructions/revoke_authority_item_v1.rs | 643 ++ .../revoke_collection_authority.rs | 285 + .../instructions/revoke_collection_item_v1.rs | 643 ++ .../instructions/revoke_collection_v1.rs | 643 ++ .../instructions/revoke_data_item_v1.rs | 643 ++ .../generated/instructions/revoke_data_v1.rs | 643 ++ .../instructions/revoke_locked_transfer_v1.rs | 625 ++ .../instructions/revoke_migration_v1.rs | 625 ++ .../revoke_programmable_config_item_v1.rs | 643 ++ .../revoke_programmable_config_v1.rs | 643 ++ .../generated/instructions/revoke_sale_v1.rs | 625 ++ .../instructions/revoke_staking_v1.rs | 625 ++ .../instructions/revoke_standard_v1.rs | 630 ++ .../instructions/revoke_transfer_v1.rs | 625 ++ .../instructions/revoke_use_authority.rs | 412 ++ .../instructions/revoke_utility_v1.rs | 625 ++ .../instructions/set_and_verify_collection.rs | 401 ++ .../set_and_verify_sized_collection_item.rs | 401 ++ .../instructions/set_collection_size.rs | 314 + .../instructions/set_token_standard.rs | 254 + .../generated/instructions/sign_metadata.rs | 177 + .../instructions/thaw_delegated_account.rs | 271 + .../instructions/transfer_out_of_escrow.rs | 571 ++ .../src/generated/instructions/transfer_v1.rs | 762 +++ .../src/generated/instructions/unlock_v1.rs | 605 ++ .../instructions/unverify_collection.rs | 339 + .../instructions/unverify_collection_v1.rs | 383 ++ .../instructions/unverify_creator_v1.rs | 401 ++ .../unverify_sized_collection_item.rs | 365 ++ .../update_as_authority_item_delegate_v2.rs | 597 ++ .../update_as_collection_delegate_v2.rs | 557 ++ .../update_as_collection_item_delegate_v2.rs | 557 ++ .../update_as_data_delegate_v2.rs | 566 ++ .../update_as_data_item_delegate_v2.rs | 566 ++ ...date_as_programmable_config_delegate_v2.rs | 542 ++ ...as_programmable_config_item_delegate_v2.rs | 544 ++ .../update_as_update_authority_v2.rs | 681 ++ .../update_metadata_account_v2.rs | 239 + .../update_primary_sale_happened_via_token.rs | 199 + .../src/generated/instructions/update_v1.rs | 667 ++ .../rust/src/generated/instructions/use_v1.rs | 595 ++ .../src/generated/instructions/utilize.rs | 521 ++ .../instructions/verify_collection.rs | 365 ++ .../instructions/verify_collection_v1.rs | 427 ++ .../instructions/verify_creator_v1.rs | 450 ++ .../verify_sized_collection_item.rs | 365 ++ clients/rust/src/generated/mod.rs | 14 + clients/rust/src/generated/programs.rs | 11 + .../src/generated/types/authority_type.rs | 18 + .../src/generated/types/authorization_data.rs | 15 + clients/rust/src/generated/types/burn_args.rs | 14 + .../rust/src/generated/types/collection.rs | 16 + .../src/generated/types/collection_details.rs | 14 + .../types/collection_details_toggle.rs | 17 + .../src/generated/types/collection_toggle.rs | 17 + .../rust/src/generated/types/create_args.rs | 36 + clients/rust/src/generated/types/creator.rs | 17 + clients/rust/src/generated/types/data_v2.rs | 23 + .../rust/src/generated/types/delegate_args.rs | 60 + .../src/generated/types/escrow_authority.rs | 16 + .../rust/src/generated/types/helper/mod.rs | 96 + clients/rust/src/generated/types/key.rs | 27 + clients/rust/src/generated/types/leaf_info.rs | 15 + clients/rust/src/generated/types/lock_args.rs | 17 + .../generated/types/metadata_delegate_role.rs | 21 + .../src/generated/types/migration_type.rs | 15 + clients/rust/src/generated/types/mint_args.rs | 18 + ...tion_from_master_edition_via_token_args.rs | 14 + clients/rust/src/generated/types/mod.rs | 92 + clients/rust/src/generated/types/payload.rs | 16 + .../rust/src/generated/types/payload_key.rs | 23 + .../rust/src/generated/types/payload_type.rs | 20 + .../rust/src/generated/types/print_args.rs | 14 + .../rust/src/generated/types/print_supply.rs | 16 + .../generated/types/programmable_config.rs | 15 + .../rust/src/generated/types/reservation.rs | 17 + .../src/generated/types/reservation_v1.rs | 17 + .../rust/src/generated/types/revoke_args.rs | 27 + .../src/generated/types/rule_set_toggle.rs | 17 + clients/rust/src/generated/types/seeds_vec.rs | 14 + .../types/set_collection_size_args.rs | 14 + .../generated/types/token_delegate_role.rs | 20 + .../src/generated/types/token_standard.rs | 19 + .../rust/src/generated/types/token_state.rs | 16 + .../rust/src/generated/types/transfer_args.rs | 18 + .../rust/src/generated/types/unlock_args.rs | 17 + .../rust/src/generated/types/update_args.rs | 108 + clients/rust/src/generated/types/use_args.rs | 17 + .../rust/src/generated/types/use_method.rs | 16 + clients/rust/src/generated/types/uses.rs | 17 + .../rust/src/generated/types/uses_toggle.rs | 17 + .../src/generated/types/verification_args.rs | 15 + .../src/hooked/metadata_delegate_role_seed.rs | 28 + clients/rust/src/hooked/mod.rs | 2 + clients/rust/src/lib.rs | 8 + configs/kinobi.cjs | 10 + configs/program-scripts/build.sh | 4 +- configs/program-scripts/sdk.sh | 22 + configs/program-scripts/test.sh | 6 +- 152 files changed, 50606 insertions(+), 5 deletions(-) create mode 100644 clients/rust/Cargo.lock create mode 100644 clients/rust/Cargo.toml create mode 100644 clients/rust/src/generated/accounts/collection_authority_record.rs create mode 100644 clients/rust/src/generated/accounts/edition.rs create mode 100644 clients/rust/src/generated/accounts/edition_marker.rs create mode 100644 clients/rust/src/generated/accounts/edition_marker_v2.rs create mode 100644 clients/rust/src/generated/accounts/master_edition.rs create mode 100644 clients/rust/src/generated/accounts/metadata.rs create mode 100644 clients/rust/src/generated/accounts/metadata_delegate_record.rs create mode 100644 clients/rust/src/generated/accounts/mod.rs create mode 100644 clients/rust/src/generated/accounts/token_owned_escrow.rs create mode 100644 clients/rust/src/generated/accounts/token_record.rs create mode 100644 clients/rust/src/generated/accounts/use_authority_record.rs create mode 100644 clients/rust/src/generated/errors/mod.rs create mode 100644 clients/rust/src/generated/errors/mpl_token_metadata.rs create mode 100644 clients/rust/src/generated/instructions/approve_collection_authority.rs create mode 100644 clients/rust/src/generated/instructions/approve_use_authority.rs create mode 100644 clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs create mode 100644 clients/rust/src/generated/instructions/burn_edition_nft.rs create mode 100644 clients/rust/src/generated/instructions/burn_nft.rs create mode 100644 clients/rust/src/generated/instructions/burn_v1.rs create mode 100644 clients/rust/src/generated/instructions/close_escrow_account.rs create mode 100644 clients/rust/src/generated/instructions/collect.rs create mode 100644 clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs create mode 100644 clients/rust/src/generated/instructions/create_escrow_account.rs create mode 100644 clients/rust/src/generated/instructions/create_master_edition_v3.rs create mode 100644 clients/rust/src/generated/instructions/create_metadata_account_v3.rs create mode 100644 clients/rust/src/generated/instructions/create_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_authority_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_collection_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_collection_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_data_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_data_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_sale_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_staking_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_standard_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_transfer_v1.rs create mode 100644 clients/rust/src/generated/instructions/delegate_utility_v1.rs create mode 100644 clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs create mode 100644 clients/rust/src/generated/instructions/freeze_delegated_account.rs create mode 100644 clients/rust/src/generated/instructions/lock_v1.rs create mode 100644 clients/rust/src/generated/instructions/migrate.rs create mode 100644 clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs create mode 100644 clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs create mode 100644 clients/rust/src/generated/instructions/mint_v1.rs create mode 100644 clients/rust/src/generated/instructions/mod.rs create mode 100644 clients/rust/src/generated/instructions/print_v1.rs create mode 100644 clients/rust/src/generated/instructions/puff_metadata.rs create mode 100644 clients/rust/src/generated/instructions/remove_creator_verification.rs create mode 100644 clients/rust/src/generated/instructions/revoke_authority_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_collection_authority.rs create mode 100644 clients/rust/src/generated/instructions/revoke_collection_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_collection_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_data_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_data_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_migration_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_sale_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_staking_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_standard_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_transfer_v1.rs create mode 100644 clients/rust/src/generated/instructions/revoke_use_authority.rs create mode 100644 clients/rust/src/generated/instructions/revoke_utility_v1.rs create mode 100644 clients/rust/src/generated/instructions/set_and_verify_collection.rs create mode 100644 clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs create mode 100644 clients/rust/src/generated/instructions/set_collection_size.rs create mode 100644 clients/rust/src/generated/instructions/set_token_standard.rs create mode 100644 clients/rust/src/generated/instructions/sign_metadata.rs create mode 100644 clients/rust/src/generated/instructions/thaw_delegated_account.rs create mode 100644 clients/rust/src/generated/instructions/transfer_out_of_escrow.rs create mode 100644 clients/rust/src/generated/instructions/transfer_v1.rs create mode 100644 clients/rust/src/generated/instructions/unlock_v1.rs create mode 100644 clients/rust/src/generated/instructions/unverify_collection.rs create mode 100644 clients/rust/src/generated/instructions/unverify_collection_v1.rs create mode 100644 clients/rust/src/generated/instructions/unverify_creator_v1.rs create mode 100644 clients/rust/src/generated/instructions/unverify_sized_collection_item.rs create mode 100644 clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_as_update_authority_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_metadata_account_v2.rs create mode 100644 clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs create mode 100644 clients/rust/src/generated/instructions/update_v1.rs create mode 100644 clients/rust/src/generated/instructions/use_v1.rs create mode 100644 clients/rust/src/generated/instructions/utilize.rs create mode 100644 clients/rust/src/generated/instructions/verify_collection.rs create mode 100644 clients/rust/src/generated/instructions/verify_collection_v1.rs create mode 100644 clients/rust/src/generated/instructions/verify_creator_v1.rs create mode 100644 clients/rust/src/generated/instructions/verify_sized_collection_item.rs create mode 100644 clients/rust/src/generated/mod.rs create mode 100644 clients/rust/src/generated/programs.rs create mode 100644 clients/rust/src/generated/types/authority_type.rs create mode 100644 clients/rust/src/generated/types/authorization_data.rs create mode 100644 clients/rust/src/generated/types/burn_args.rs create mode 100644 clients/rust/src/generated/types/collection.rs create mode 100644 clients/rust/src/generated/types/collection_details.rs create mode 100644 clients/rust/src/generated/types/collection_details_toggle.rs create mode 100644 clients/rust/src/generated/types/collection_toggle.rs create mode 100644 clients/rust/src/generated/types/create_args.rs create mode 100644 clients/rust/src/generated/types/creator.rs create mode 100644 clients/rust/src/generated/types/data_v2.rs create mode 100644 clients/rust/src/generated/types/delegate_args.rs create mode 100644 clients/rust/src/generated/types/escrow_authority.rs create mode 100644 clients/rust/src/generated/types/helper/mod.rs create mode 100644 clients/rust/src/generated/types/key.rs create mode 100644 clients/rust/src/generated/types/leaf_info.rs create mode 100644 clients/rust/src/generated/types/lock_args.rs create mode 100644 clients/rust/src/generated/types/metadata_delegate_role.rs create mode 100644 clients/rust/src/generated/types/migration_type.rs create mode 100644 clients/rust/src/generated/types/mint_args.rs create mode 100644 clients/rust/src/generated/types/mint_new_edition_from_master_edition_via_token_args.rs create mode 100644 clients/rust/src/generated/types/mod.rs create mode 100644 clients/rust/src/generated/types/payload.rs create mode 100644 clients/rust/src/generated/types/payload_key.rs create mode 100644 clients/rust/src/generated/types/payload_type.rs create mode 100644 clients/rust/src/generated/types/print_args.rs create mode 100644 clients/rust/src/generated/types/print_supply.rs create mode 100644 clients/rust/src/generated/types/programmable_config.rs create mode 100644 clients/rust/src/generated/types/reservation.rs create mode 100644 clients/rust/src/generated/types/reservation_v1.rs create mode 100644 clients/rust/src/generated/types/revoke_args.rs create mode 100644 clients/rust/src/generated/types/rule_set_toggle.rs create mode 100644 clients/rust/src/generated/types/seeds_vec.rs create mode 100644 clients/rust/src/generated/types/set_collection_size_args.rs create mode 100644 clients/rust/src/generated/types/token_delegate_role.rs create mode 100644 clients/rust/src/generated/types/token_standard.rs create mode 100644 clients/rust/src/generated/types/token_state.rs create mode 100644 clients/rust/src/generated/types/transfer_args.rs create mode 100644 clients/rust/src/generated/types/unlock_args.rs create mode 100644 clients/rust/src/generated/types/update_args.rs create mode 100644 clients/rust/src/generated/types/use_args.rs create mode 100644 clients/rust/src/generated/types/use_method.rs create mode 100644 clients/rust/src/generated/types/uses.rs create mode 100644 clients/rust/src/generated/types/uses_toggle.rs create mode 100644 clients/rust/src/generated/types/verification_args.rs create mode 100644 clients/rust/src/hooked/metadata_delegate_role_seed.rs create mode 100644 clients/rust/src/hooked/mod.rs create mode 100644 clients/rust/src/lib.rs create mode 100755 configs/program-scripts/sdk.sh diff --git a/.vscode/settings.json b/.vscode/settings.json index 4547514d..fc4904d3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "rust-analyzer.linkedProjects": [ + "./clients/rust/Cargo.toml", "./programs/token-metadata/Cargo.toml", ] } \ No newline at end of file diff --git a/clients/rust/Cargo.lock b/clients/rust/Cargo.lock new file mode 100644 index 00000000..4265f556 --- /dev/null +++ b/clients/rust/Cargo.lock @@ -0,0 +1,5558 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +dependencies = [ + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint 0.4.3", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.3", + "num-traits", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.3", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.25", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-compression" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "blake3" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2 1.0.66", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", + "proc-macro-crate 0.1.5", + "proc-macro2 1.0.66", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "caps" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" +dependencies = [ + "libc", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_lex", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.16.0", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.66", + "quote 1.0.33", + "strsim 0.10.0", + "syn 2.0.29", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", + "rayon", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint 0.4.3", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "dir-diff" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2860407d7d7e2e004bb2128510ad9e8d669e76fa005ccf567977b5d71b8b4a0b" +dependencies = [ + "walkdir", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "dlopen" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +dependencies = [ + "dlopen_derive", + "lazy_static", + "libc", + "winapi", +] + +[[package]] +name = "dlopen_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +dependencies = [ + "libc", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "eager" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek-bip32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.7", +] + +[[package]] +name = "educe" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "079044df30bb07de7d846d41a184c4b00e66ebdac93ee459253474f3a47e50ae" +dependencies = [ + "enum-ordinalize", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-iterator" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "enum-ordinalize" +version = "3.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4f76552f53cefc9a7f64987c3701b99d982f7690606fd67de1d09712fbf52f1" +dependencies = [ + "num-bigint 0.4.3", + "num-traits", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util 0.7.2", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "histogram" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "index_list" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9d968042a4902e08810946fc7cd5851eb75e80301342305af755ca06cb82ce" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "indicatif" +version = "0.17.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "mpl-token-metadata-sdk" +version = "0.0.1" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "solana-program", + "solana-program-test", + "solana-sdk", + "spl-associated-token-account 2.0.0", + "spl-token 4.0.0", + "thiserror", +] + +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", + "static_assertions", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", +] + +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.2", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", +] + +[[package]] +name = "os_str_bytes" +version = "6.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" + +[[package]] +name = "ouroboros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +dependencies = [ + "aliasable", + "ouroboros_macro", +] + +[[package]] +name = "ouroboros_macro" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +dependencies = [ + "Inflector", + "proc-macro-error", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.8", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets 0.48.3", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "quinn" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-proto" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring", + "rustc-hash", + "rustls", + "rustls-native-certs", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-udp" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +dependencies = [ + "libc", + "quinn-proto", + "socket2", + "tracing", + "windows-sys 0.42.0", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2 1.0.66", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring", + "time 0.3.25", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + +[[package]] +name = "reqwest" +version = "0.11.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +dependencies = [ + "async-compression", + "base64 0.21.2", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tokio-util 0.7.2", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rpassword" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +dependencies = [ + "libc", + "rtoolbox", + "winapi", +] + +[[package]] +name = "rtoolbox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.2", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + +[[package]] +name = "serde" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "serde_json" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "solana-account-decoder" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3fd71c1b3a1bd76840b627a85e0580dc85a5db59259d6f2129eb4bea8ff628" +dependencies = [ + "Inflector", + "base64 0.21.2", + "bincode", + "bs58", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-address-lookup-table-program", + "solana-config-program", + "solana-sdk", + "spl-token 3.5.0", + "spl-token-2022 0.6.1", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147c6ac17124380edf2e5a505da0e2c22ad300c3b532cad4497a6da3a9bc54dc" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-banks-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c065226230d17f5e333e6ad60db639c4d3d716ca1b2c8b2d8e8e8412f943709" +dependencies = [ + "borsh 0.10.3", + "futures", + "solana-banks-interface", + "solana-program", + "solana-sdk", + "tarpc", + "thiserror", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1093af4fc53baf6a051bbce55f02da8b19d333fe594c79217ee8f5df79cd1161" +dependencies = [ + "serde", + "solana-sdk", + "tarpc", +] + +[[package]] +name = "solana-banks-server" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79583c0841f867d1968ef41564c8a0f4cbc1d9e6616f2d4a26a61ed953b1c00" +dependencies = [ + "bincode", + "crossbeam-channel", + "futures", + "solana-banks-interface", + "solana-client", + "solana-runtime", + "solana-sdk", + "solana-send-transaction-service", + "tarpc", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-bpf-loader-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31028b291651242916318f5fb277387ac2ac822ec397af9e739909fd8183ad0a" +dependencies = [ + "bincode", + "byteorder", + "libsecp256k1", + "log", + "rand 0.7.3", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-bucket-map" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db635df62e3f1e3b6661ea1e93dbb14e6ef2ddd86ccac72a7842bb594e399f4c" +dependencies = [ + "bv", + "log", + "memmap2", + "modular-bitfield", + "num_enum 0.6.1", + "rand 0.7.3", + "solana-measure", + "solana-sdk", + "tempfile", +] + +[[package]] +name = "solana-clap-utils" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce466531351ab81e9931122bd779369af20f4816f2706b4af47c3ea989de5447" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-perf", + "solana-remote-wallet", + "solana-sdk", + "thiserror", + "tiny-bip39", + "uriparse", + "url", +] + +[[package]] +name = "solana-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59d5c898cc260d747f1fafc38faf3005b94737c660047381236b57448a008b10" +dependencies = [ + "async-trait", + "bincode", + "futures", + "futures-util", + "indexmap 1.9.3", + "indicatif", + "log", + "quinn", + "rand 0.7.3", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-rpc-client-nonce-utils", + "solana-sdk", + "solana-streamer", + "solana-thin-client", + "solana-tpu-client", + "solana-udp-client", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-compute-budget-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98312eeab2d9879bcac78cce213fe65a9d929df6d541c0dcd0ef918968ea2cca" +dependencies = [ + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-config-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaee2ae2c20c8f4d1f4a71fdef18b846ed526a62f3960c1dd397e3214a5c3636" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-connection-cache" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3a18a36fe35598469fbfd3909fcdee3790225367d4a1b6ac3bb77d333cc72" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 1.9.3", + "log", + "rand 0.7.3", + "rayon", + "rcgen", + "solana-measure", + "solana-metrics", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-frozen-abi" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c99cfa99557c93f82428f19629d7aa0bb069a740f5caf0ae0654853e9930cd4c" +dependencies = [ + "ahash 0.8.3", + "blake3", + "block-buffer 0.10.4", + "bs58", + "bv", + "byteorder", + "cc", + "either", + "generic-array", + "getrandom 0.1.16", + "im", + "lazy_static", + "log", + "memmap2", + "once_cell", + "rand_core 0.6.4", + "rustc_version", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.7", + "solana-frozen-abi-macro", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f9a943b7e086970c1f131c82bed6788b788b49c6b3579388f4989cfcfb47db" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "rustc_version", + "syn 2.0.29", +] + +[[package]] +name = "solana-loader-v4-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a41c7ce3e3a4a64c8a27aea05e8661a1d1f7c1d78d0d8d676223b714180752" +dependencies = [ + "log", + "rand 0.7.3", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana_rbpf", +] + +[[package]] +name = "solana-logger" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc71a75f90306445902cd0fb1082761bcf5a5b244738e557edfd6ca75f94019a" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "solana-measure" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2426169e601a2bb12b966b076d5fc33943227e555abb36216f7bf20584cde8e7" +dependencies = [ + "log", + "solana-sdk", +] + +[[package]] +name = "solana-metrics" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88eab2455a9c2ecf436a503fdc15c64bf8079dbb18f55172b88bcf3b9a3b0a56" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk", +] + +[[package]] +name = "solana-net-utils" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6bb6bbfc5b19829d0ae30cb77f6942600ddf013b3ea9529c50ca61a18cedd59" +dependencies = [ + "bincode", + "clap 3.2.25", + "crossbeam-channel", + "log", + "nix", + "rand 0.7.3", + "serde", + "serde_derive", + "socket2", + "solana-logger", + "solana-sdk", + "solana-version", + "tokio", + "url", +] + +[[package]] +name = "solana-perf" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d981579ffa092782bc6deb4510106ce230a0c8074c932bb2564d5e1d9cbe72b" +dependencies = [ + "ahash 0.8.3", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen", + "dlopen_derive", + "fnv", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.7.3", + "rayon", + "serde", + "solana-metrics", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f0785c04ca7709464aa99e3e960a5c09e2318da8658833d410e157b3292a69" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "array-bytes", + "base64 0.21.2", + "bincode", + "bitflags 1.3.2", + "blake3", + "borsh 0.10.3", + "borsh 0.9.3", + "bs58", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.10", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "log", + "memoffset 0.9.0", + "num-bigint 0.4.3", + "num-derive", + "num-traits", + "parking_lot 0.12.1", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.7", + "sha3 0.10.8", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-program-runtime" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a76c947ee87c148f646f961d67580402fbe69825e017053fc3cd271afb3eefe" +dependencies = [ + "base64 0.21.2", + "bincode", + "eager", + "enum-iterator", + "itertools", + "libc", + "log", + "num-derive", + "num-traits", + "percentage", + "rand 0.7.3", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-program-test" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "333ec33b37d85f48669b3d1f9c68a4b8fcfefe906ed7262c7ed90aa565cd175b" +dependencies = [ + "assert_matches", + "async-trait", + "base64 0.21.2", + "bincode", + "chrono-humanize", + "crossbeam-channel", + "log", + "serde", + "solana-banks-client", + "solana-banks-interface", + "solana-banks-server", + "solana-bpf-loader-program", + "solana-logger", + "solana-program-runtime", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-pubsub-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89db8eabe8a22f565a8c26449a65dc80acd9ae5332a2008649c464e75714039" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a944cbeec6904d1023186dd9387f3f498b369c54f2bb7e55e2d76ab6a069bf" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "quinn-udp", + "rcgen", + "rustls", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c699b849a013036f6bda8219ecb2803708df2a829042ae909ceb939c77b44970" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "056e7531f56893258151396b97a0da757f4deea55192c08df9c62cb62b82e957" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive", + "num-traits", + "parking_lot 0.12.1", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + +[[package]] +name = "solana-rpc-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d904dc51c52242b2e9e14b927af70ea04f0f74c99fa5db42981598885061b6" +dependencies = [ + "async-trait", + "base64 0.21.2", + "bincode", + "bs58", + "indicatif", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bdf329e0d27ecbbfb73e5a060a23e9f9a26619b5ed56f673465342da1609e7c" +dependencies = [ + "base64 0.21.2", + "bs58", + "jsonrpc-core", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "spl-token-2022 0.6.1", + "thiserror", +] + +[[package]] +name = "solana-rpc-client-nonce-utils" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf7e472d24e18f6d8e7e2dd7b5c71c02b0768898bad4cf4465542bdca91be9a" +dependencies = [ + "clap 2.34.0", + "solana-clap-utils", + "solana-rpc-client", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-runtime" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517d0900bd0e71a5748674820724b605f30cbe5b8d38ed83b520dddd0177b54" +dependencies = [ + "arrayref", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "dir-diff", + "flate2", + "fnv", + "im", + "index_list", + "itertools", + "lazy_static", + "log", + "lru", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive", + "num-traits", + "num_cpus", + "num_enum 0.6.1", + "once_cell", + "ouroboros", + "percentage", + "rand 0.7.3", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-bucket-map", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-measure", + "solana-metrics", + "solana-perf", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", + "solana-zk-token-proof-program", + "solana-zk-token-sdk", + "static_assertions", + "strum", + "strum_macros", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-sdk" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ba95264245a5e9597362e4e6e3a50b538fbe5aaaf017af665a49b541beb25" +dependencies = [ + "assert_matches", + "base64 0.21.2", + "bincode", + "bitflags 1.3.2", + "borsh 0.10.3", + "bs58", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.7", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive", + "num-traits", + "num_enum 0.6.1", + "pbkdf2 0.11.0", + "qstring", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "serde_with", + "sha2 0.10.7", + "sha3 0.10.8", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-logger", + "solana-program", + "solana-sdk-macro", + "thiserror", + "uriparse", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0d5ec9d1e765173704cbe8ea7d8c8d69a9f879d7e71ae7deb0632f9f0ee429" +dependencies = [ + "bs58", + "proc-macro2 1.0.66", + "quote 1.0.33", + "rustversion", + "syn 2.0.29", +] + +[[package]] +name = "solana-send-transaction-service" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5baf132146882c71da736b4b3efa16cd04464ceaae5d9234bd28bbd622bbc97" +dependencies = [ + "crossbeam-channel", + "log", + "solana-client", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-tpu-client", +] + +[[package]] +name = "solana-stake-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6601e81f96bb9444c8690b4889a38ae4b8f60f5239207ed71605b234e36a9527" +dependencies = [ + "bincode", + "log", + "rustc_version", + "solana-config-program", + "solana-program-runtime", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-streamer" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7889fb97171c64e06ec4f0efd236aca6873254888a6bf51bb4292e1436b3fdb1" +dependencies = [ + "async-channel", + "bytes", + "crossbeam-channel", + "futures-util", + "histogram", + "indexmap 1.9.3", + "itertools", + "libc", + "log", + "nix", + "pem", + "percentage", + "pkcs8", + "quinn", + "quinn-proto", + "quinn-udp", + "rand 0.7.3", + "rcgen", + "rustls", + "solana-metrics", + "solana-perf", + "solana-sdk", + "thiserror", + "tokio", + "x509-parser", +] + +[[package]] +name = "solana-system-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e517487a4115b233260d83fbabf6df6c0b86d5a1f905f06b2498d7987ff0ee68" +dependencies = [ + "bincode", + "log", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-thin-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fa94bf1d27b4b4d9c593843f365d635bd276925fa61a7cedbe6bb816225128d" +dependencies = [ + "bincode", + "log", + "rayon", + "solana-connection-cache", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", +] + +[[package]] +name = "solana-tpu-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ab6dbd623ec97b471b490f741795559a48299af860b9cab4c7ccd2c916d0fd" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 1.9.3", + "indicatif", + "log", + "rand 0.7.3", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-transaction-status" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95e5aba173da8ee65e38e4ac55390eaccebff160117e919a73e1d28085e8a203" +dependencies = [ + "Inflector", + "base64 0.21.2", + "bincode", + "borsh 0.9.3", + "bs58", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-address-lookup-table-program", + "solana-sdk", + "spl-associated-token-account 1.1.3", + "spl-memo", + "spl-token 3.5.0", + "spl-token-2022 0.6.1", + "thiserror", +] + +[[package]] +name = "solana-udp-client" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "265ce6ae58aacdb5e04a9a579afefc3d0bb61c7c5a00df2dcde2315ace0031e5" +dependencies = [ + "async-trait", + "solana-connection-cache", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-version" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "192ed87b9562c2a15015f51ff5de560b59fa2cd244d2bb0146524af0a693a3b1" +dependencies = [ + "log", + "rustc_version", + "semver", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", +] + +[[package]] +name = "solana-vote-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1910068b362f9b57748e6a0310b178b6c2dc377f3ba9489fd7d66d994ed7ca36" +dependencies = [ + "bincode", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-zk-token-proof-program" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4830b0ee93e17800f1b82acacf2c4df28e9feb4d29c2153c6723789f2d3c54e9" +dependencies = [ + "bytemuck", + "getrandom 0.1.16", + "num-derive", + "num-traits", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "1.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2822252ffc52c7415fcd0c468fa3c13cbc50bd181087d366fe511d891445cd" +dependencies = [ + "aes-gcm-siv", + "base64 0.21.2", + "bincode", + "bytemuck", + "byteorder", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools", + "lazy_static", + "merlin", + "num-derive", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "solana_rbpf" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3082ec3a1d4ef7879eb5b84916d5acde057abd59733eec3647e0ab8885283ef" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "spl-associated-token-account" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" +dependencies = [ + "assert_matches", + "borsh 0.9.3", + "num-derive", + "num-traits", + "solana-program", + "spl-token 3.5.0", + "spl-token-2022 0.6.1", + "thiserror", +] + +[[package]] +name = "spl-associated-token-account" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02693d7b36cea2b45318b87f22406909879226963296f31f4ebb0fc7f6e1aeb3" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "num-derive", + "num-traits", + "solana-program", + "spl-token 4.0.0", + "spl-token-2022 0.7.0", + "thiserror", +] + +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4fa8f409b5c5e0ac571df17c981ae1424b204743daa4428430627d38717caf5" +dependencies = [ + "quote 1.0.33", + "spl-discriminator-syn", + "syn 2.0.29", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21968d7da2f0a624c509f24580c3fee70b364a6886d90709e679e64f572eca2f" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "solana-program", + "syn 2.0.29", + "thiserror", +] + +[[package]] +name = "spl-memo" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-program-error" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af92f74cd3b0fdfda59fef4b571a92123e4df0f67cc43f73163975d31118ef82" +dependencies = [ + "num-derive", + "num-traits", + "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173f3cc506847882189b3a5b67299f617fed2f9730f122dd197b82e1e213dee5" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82149a5a06b5f158d03904066375eaf0c8a2422557cc3d5a25d277260d9a3b16" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-token" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum 0.5.11", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum 0.5.11", + "solana-program", + "solana-zk-token-sdk", + "spl-memo", + "spl-token 3.5.0", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b24ac5786a3fefbf59f5606312c61abf87b23154e7a717e5d18216fbea4711db" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "solana-zk-token-sdk", + "spl-memo", + "spl-token 4.0.0", + "spl-transfer-hook-interface", + "thiserror", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a2326852adf88716fbac7f54cd6ee2c8a0b5a14ede24db3b4519c4ff13df04b" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "spl-discriminator", + "spl-tlv-account-resolution", + "spl-type-length-value", + "thiserror", +] + +[[package]] +name = "spl-type-length-value" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d085f426b33b8365fb98383d1b8b3925e21bdfe579c851ceaa7f511dbec191" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-program-error", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2 1.0.66", + "quote 1.0.33", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", + "unicode-xid 0.2.4", +] + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tarpc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +dependencies = [ + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", +] + +[[package]] +name = "tarpc-plugins" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "tempfile" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +dependencies = [ + "deranged", + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +dependencies = [ + "time-core", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d0183f6f6001549ab68f8c7585093bb732beefbcf6d23a10b9b95c73a1dd49" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot 0.11.2", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", +] + +[[package]] +name = "tokio-stream" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki", + "webpki-roots", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap 2.0.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "tungstenite" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls", + "sha-1", + "thiserror", + "url", + "utf-8", + "webpki", + "webpki-roots", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote 1.0.33", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.3", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.3", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f51fb4c64f8b770a823c043c7fad036323e1c48f55287b7bbb7987b2fcdf3b" +dependencies = [ + "windows_aarch64_gnullvm 0.48.3", + "windows_aarch64_msvc 0.48.3", + "windows_i686_gnu 0.48.3", + "windows_i686_msvc 0.48.3", + "windows_x86_64_gnu 0.48.3", + "windows_x86_64_gnullvm 0.48.3", + "windows_x86_64_msvc 0.48.3", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde1bb55ae4ce76a597a8566d82c57432bc69c039449d61572a7a353da28f68c" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1513e8d48365a78adad7322fd6b5e4c4e99d92a69db8df2d435b25b1f1f286d4" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60587c0265d2b842298f5858e1a5d79d146f9ee0c37be5782e92a6eb5e1d7a83" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224fe0e0ffff5d2ea6a29f82026c8f43870038a0ffc247aa95a52b47df381ac4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62fc52a0f50a088de499712cbc012df7ebd94e2d6eb948435449d76a6287e7ad" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2093925509d91ea3d69bcd20238f4c2ecdb1a29d3c281d026a09705d0dd35f3d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6ade45bc8bf02ae2aa34a9d54ba660a1a58204da34ba793c00d83ca3730b5f1" + +[[package]] +name = "winnow" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83817bbecf72c73bad717ee86820ebf286203d2e04c3951f3cd538869c897364" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time 0.3.25", +] + +[[package]] +name = "xattr" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +dependencies = [ + "libc", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.25", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", +] diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml new file mode 100644 index 00000000..d5b943f6 --- /dev/null +++ b/clients/rust/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "mpl-token-metadata-sdk" +version = "0.0.1" +description = "Metaplex Token Metadata" +authors = ["Metaplex Developers "] +repository = "https://github.com/metaplex-foundation/mpl-token-metadata" +license-file = "../../LICENSE" +edition = "2021" +readme = "../../programs/token-metadata/program/README.md" + +[lib] +crate-type = ["cdylib", "lib"] + +[features] +test-sbf = [] + +[dependencies] +solana-program = "^1.10" +borsh = ">= 0.9" +thiserror = "^1.0" + +[dev-dependencies] +assert_matches = "1.5.0" +solana-program-test = "^1.10" +solana-sdk = "^1.10" +spl-token = { version = ">= 3.5.0, < 5.0", features = ["no-entrypoint"] } +spl-associated-token-account = { version = ">= 1.1.3, < 3.0", features = ["no-entrypoint"] } diff --git a/clients/rust/src/generated/accounts/collection_authority_record.rs b/clients/rust/src/generated/accounts/collection_authority_record.rs new file mode 100644 index 00000000..3a69864c --- /dev/null +++ b/clients/rust/src/generated/accounts/collection_authority_record.rs @@ -0,0 +1,53 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct CollectionAuthorityRecord { + pub key: Key, + pub bump: u8, + pub update_authority: Option, +} + +impl CollectionAuthorityRecord { + pub fn find_pda( + mint: &Pubkey, + collection_authority: &Pubkey, + ) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "collection_authority".as_bytes(), + collection_authority.as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + collection_authority: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "collection_authority".as_bytes(), + collection_authority.as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/accounts/edition.rs b/clients/rust/src/generated/accounts/edition.rs new file mode 100644 index 00000000..8b089cd6 --- /dev/null +++ b/clients/rust/src/generated/accounts/edition.rs @@ -0,0 +1,22 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Edition { + pub key: Key, + pub parent: Pubkey, + pub edition: u64, +} + +impl Edition { + pub const LEN: usize = 41; +} diff --git a/clients/rust/src/generated/accounts/edition_marker.rs b/clients/rust/src/generated/accounts/edition_marker.rs new file mode 100644 index 00000000..d8dfba47 --- /dev/null +++ b/clients/rust/src/generated/accounts/edition_marker.rs @@ -0,0 +1,51 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct EditionMarker { + pub key: Key, + pub ledger: [u8; 31], +} + +impl EditionMarker { + pub const LEN: usize = 32; + + pub fn find_pda(mint: &Pubkey, edition_marker: &str) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "edition".as_bytes(), + edition_marker.to_string().as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + edition_marker: &str, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "edition".as_bytes(), + edition_marker.to_string().as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/accounts/edition_marker_v2.rs b/clients/rust/src/generated/accounts/edition_marker_v2.rs new file mode 100644 index 00000000..c5e40ebf --- /dev/null +++ b/clients/rust/src/generated/accounts/edition_marker_v2.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct EditionMarkerV2 { + pub key: Key, + pub ledger: Vec, +} diff --git a/clients/rust/src/generated/accounts/master_edition.rs b/clients/rust/src/generated/accounts/master_edition.rs new file mode 100644 index 00000000..ea4242a0 --- /dev/null +++ b/clients/rust/src/generated/accounts/master_edition.rs @@ -0,0 +1,49 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct MasterEdition { + pub key: Key, + pub supply: u64, + pub max_supply: Option, +} + +impl MasterEdition { + pub const LEN: usize = 282; + + pub fn find_pda(mint: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "edition".as_bytes(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "edition".as_bytes(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/accounts/metadata.rs b/clients/rust/src/generated/accounts/metadata.rs new file mode 100644 index 00000000..f5a48b74 --- /dev/null +++ b/clients/rust/src/generated/accounts/metadata.rs @@ -0,0 +1,66 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Collection; +use crate::generated::types::CollectionDetails; +use crate::generated::types::Creator; +use crate::generated::types::Key; +use crate::generated::types::ProgrammableConfig; +use crate::generated::types::TokenStandard; +use crate::generated::types::Uses; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Metadata { + pub key: Key, + pub update_authority: Pubkey, + pub mint: Pubkey, + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, + pub primary_sale_happened: bool, + pub is_mutable: bool, + pub edition_nonce: Option, + pub token_standard: Option, + pub collection: Option, + pub uses: Option, + pub collection_details: Option, + pub programmable_config: Option, +} + +impl Metadata { + pub const LEN: usize = 679; + + pub fn find_pda(mint: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs new file mode 100644 index 00000000..db332899 --- /dev/null +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -0,0 +1,64 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use crate::hooked::MetadataDelegateRoleSeed; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct MetadataDelegateRecord { + pub key: Key, + pub bump: u8, + pub mint: Pubkey, + pub delegate: Pubkey, + pub update_authority: Pubkey, +} + +impl MetadataDelegateRecord { + pub const LEN: usize = 98; + + pub fn find_pda( + mint: &Pubkey, + delegate_role: MetadataDelegateRoleSeed, + update_authority: &Pubkey, + delegate: &Pubkey, + ) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + delegate_role.to_string().as_ref(), + update_authority.as_ref(), + delegate.as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + delegate_role: MetadataDelegateRoleSeed, + update_authority: Pubkey, + delegate: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + delegate_role.to_string().as_ref(), + update_authority.as_ref(), + delegate.as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/accounts/mod.rs b/clients/rust/src/generated/accounts/mod.rs new file mode 100644 index 00000000..a2fd9d0b --- /dev/null +++ b/clients/rust/src/generated/accounts/mod.rs @@ -0,0 +1,28 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +mod collection_authority_record; +mod edition; +mod edition_marker; +mod edition_marker_v2; +mod master_edition; +mod metadata; +mod metadata_delegate_record; +mod token_owned_escrow; +mod token_record; +mod use_authority_record; + +pub use collection_authority_record::*; +pub use edition::*; +pub use edition_marker::*; +pub use edition_marker_v2::*; +pub use master_edition::*; +pub use metadata::*; +pub use metadata_delegate_record::*; +pub use token_owned_escrow::*; +pub use token_record::*; +pub use use_authority_record::*; diff --git a/clients/rust/src/generated/accounts/token_owned_escrow.rs b/clients/rust/src/generated/accounts/token_owned_escrow.rs new file mode 100644 index 00000000..478dd786 --- /dev/null +++ b/clients/rust/src/generated/accounts/token_owned_escrow.rs @@ -0,0 +1,20 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::EscrowAuthority; +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct TokenOwnedEscrow { + pub key: Key, + pub base_token: Pubkey, + pub authority: EscrowAuthority, + pub bump: u8, +} diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs new file mode 100644 index 00000000..3186a7a1 --- /dev/null +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -0,0 +1,58 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use crate::generated::types::TokenDelegateRole; +use crate::generated::types::TokenState; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct TokenRecord { + pub key: Key, + pub bump: u8, + pub state: TokenState, + pub rule_set_revision: Option, + pub delegate: Option, + pub delegate_role: Option, + pub locked_transfer: Option, +} + +impl TokenRecord { + pub const LEN: usize = 80; + + pub fn find_pda(mint: &Pubkey, token: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "token_record".as_bytes(), + token.as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + token: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "token_record".as_bytes(), + token.as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/accounts/use_authority_record.rs b/clients/rust/src/generated/accounts/use_authority_record.rs new file mode 100644 index 00000000..7876085e --- /dev/null +++ b/clients/rust/src/generated/accounts/use_authority_record.rs @@ -0,0 +1,52 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UseAuthorityRecord { + pub key: Key, + pub allowed_uses: u64, + pub bump: u8, +} + +impl UseAuthorityRecord { + pub const LEN: usize = 10; + + pub fn find_pda(mint: &Pubkey, use_authority: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "user".as_bytes(), + use_authority.as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + use_authority: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "user".as_bytes(), + use_authority.as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} diff --git a/clients/rust/src/generated/errors/mod.rs b/clients/rust/src/generated/errors/mod.rs new file mode 100644 index 00000000..b2dd94ed --- /dev/null +++ b/clients/rust/src/generated/errors/mod.rs @@ -0,0 +1,10 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +mod mpl_token_metadata; + +pub use mpl_token_metadata::MplTokenMetadataError; diff --git a/clients/rust/src/generated/errors/mpl_token_metadata.rs b/clients/rust/src/generated/errors/mpl_token_metadata.rs new file mode 100644 index 00000000..8f2f7fbc --- /dev/null +++ b/clients/rust/src/generated/errors/mpl_token_metadata.rs @@ -0,0 +1,591 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use thiserror::Error; + +#[derive(Clone, Debug, Eq, Error, PartialEq)] +pub enum MplTokenMetadataError { + /// 0x0 - + #[error("")] + InstructionUnpackError, + /// 0x1 - + #[error("")] + InstructionPackError, + /// 0x2 - Lamport balance below rent-exempt threshold + #[error("Lamport balance below rent-exempt threshold")] + NotRentExempt, + /// 0x3 - Already initialized + #[error("Already initialized")] + AlreadyInitialized, + /// 0x4 - Uninitialized + #[error("Uninitialized")] + Uninitialized, + /// 0x5 - Metadata's key must match seed of ['metadata', program id, mint] provided + #[error(" Metadata's key must match seed of ['metadata', program id, mint] provided")] + InvalidMetadataKey, + /// 0x6 - Edition's key must match seed of ['metadata', program id, name, 'edition'] provided + #[error("Edition's key must match seed of ['metadata', program id, name, 'edition'] provided")] + InvalidEditionKey, + /// 0x7 - Update Authority given does not match + #[error("Update Authority given does not match")] + UpdateAuthorityIncorrect, + /// 0x8 - Update Authority needs to be signer to update metadata + #[error("Update Authority needs to be signer to update metadata")] + UpdateAuthorityIsNotSigner, + /// 0x9 - You must be the mint authority and signer on this transaction + #[error("You must be the mint authority and signer on this transaction")] + NotMintAuthority, + /// 0xa - Mint authority provided does not match the authority on the mint + #[error("Mint authority provided does not match the authority on the mint")] + InvalidMintAuthority, + /// 0xb - Name too long + #[error("Name too long")] + NameTooLong, + /// 0xc - Symbol too long + #[error("Symbol too long")] + SymbolTooLong, + /// 0xd - URI too long + #[error("URI too long")] + UriTooLong, + /// 0xe - + #[error("")] + UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner, + /// 0xf - Mint given does not match mint on Metadata + #[error("Mint given does not match mint on Metadata")] + MintMismatch, + /// 0x10 - Editions must have exactly one token + #[error("Editions must have exactly one token")] + EditionsMustHaveExactlyOneToken, + /// 0x11 - + #[error("")] + MaxEditionsMintedAlready, + /// 0x12 - + #[error("")] + TokenMintToFailed, + /// 0x13 - + #[error("")] + MasterRecordMismatch, + /// 0x14 - + #[error("")] + DestinationMintMismatch, + /// 0x15 - + #[error("")] + EditionAlreadyMinted, + /// 0x16 - + #[error("")] + PrintingMintDecimalsShouldBeZero, + /// 0x17 - + #[error("")] + OneTimePrintingAuthorizationMintDecimalsShouldBeZero, + /// 0x18 - EditionMintDecimalsShouldBeZero + #[error("EditionMintDecimalsShouldBeZero")] + EditionMintDecimalsShouldBeZero, + /// 0x19 - + #[error("")] + TokenBurnFailed, + /// 0x1a - + #[error("")] + TokenAccountOneTimeAuthMintMismatch, + /// 0x1b - Derived key invalid + #[error("Derived key invalid")] + DerivedKeyInvalid, + /// 0x1c - The Printing mint does not match that on the master edition! + #[error("The Printing mint does not match that on the master edition!")] + PrintingMintMismatch, + /// 0x1d - The One Time Printing Auth mint does not match that on the master edition! + #[error("The One Time Printing Auth mint does not match that on the master edition!")] + OneTimePrintingAuthMintMismatch, + /// 0x1e - The mint of the token account does not match the Printing mint! + #[error("The mint of the token account does not match the Printing mint!")] + TokenAccountMintMismatch, + /// 0x1f - The mint of the token account does not match the master metadata mint! + #[error("The mint of the token account does not match the master metadata mint!")] + TokenAccountMintMismatchV2, + /// 0x20 - Not enough tokens to mint a limited edition + #[error("Not enough tokens to mint a limited edition")] + NotEnoughTokens, + /// 0x21 - + #[error("")] + PrintingMintAuthorizationAccountMismatch, + /// 0x22 - + #[error("")] + AuthorizationTokenAccountOwnerMismatch, + /// 0x23 - + #[error("")] + Disabled, + /// 0x24 - Creators list too long + #[error("Creators list too long")] + CreatorsTooLong, + /// 0x25 - Creators must be at least one if set + #[error("Creators must be at least one if set")] + CreatorsMustBeAtleastOne, + /// 0x26 - + #[error("")] + MustBeOneOfCreators, + /// 0x27 - This metadata does not have creators + #[error("This metadata does not have creators")] + NoCreatorsPresentOnMetadata, + /// 0x28 - This creator address was not found + #[error("This creator address was not found")] + CreatorNotFound, + /// 0x29 - Basis points cannot be more than 10000 + #[error("Basis points cannot be more than 10000")] + InvalidBasisPoints, + /// 0x2a - Primary sale can only be flipped to true and is immutable + #[error("Primary sale can only be flipped to true and is immutable")] + PrimarySaleCanOnlyBeFlippedToTrue, + /// 0x2b - Owner does not match that on the account given + #[error("Owner does not match that on the account given")] + OwnerMismatch, + /// 0x2c - This account has no tokens to be used for authorization + #[error("This account has no tokens to be used for authorization")] + NoBalanceInAccountForAuthorization, + /// 0x2d - Share total must equal 100 for creator array + #[error("Share total must equal 100 for creator array")] + ShareTotalMustBe100, + /// 0x2e - + #[error("")] + ReservationExists, + /// 0x2f - + #[error("")] + ReservationDoesNotExist, + /// 0x30 - + #[error("")] + ReservationNotSet, + /// 0x31 - + #[error("")] + ReservationAlreadyMade, + /// 0x32 - + #[error("")] + BeyondMaxAddressSize, + /// 0x33 - NumericalOverflowError + #[error("NumericalOverflowError")] + NumericalOverflowError, + /// 0x34 - + #[error("")] + ReservationBreachesMaximumSupply, + /// 0x35 - + #[error("")] + AddressNotInReservation, + /// 0x36 - You cannot unilaterally verify another creator, they must sign + #[error("You cannot unilaterally verify another creator, they must sign")] + CannotVerifyAnotherCreator, + /// 0x37 - You cannot unilaterally unverify another creator + #[error("You cannot unilaterally unverify another creator")] + CannotUnverifyAnotherCreator, + /// 0x38 - + #[error("")] + SpotMismatch, + /// 0x39 - Incorrect account owner + #[error("Incorrect account owner")] + IncorrectOwner, + /// 0x3a - + #[error("")] + PrintingWouldBreachMaximumSupply, + /// 0x3b - Data is immutable + #[error("Data is immutable")] + DataIsImmutable, + /// 0x3c - No duplicate creator addresses + #[error("No duplicate creator addresses")] + DuplicateCreatorAddress, + /// 0x3d - + #[error("")] + ReservationSpotsRemainingShouldMatchTotalSpotsAtStart, + /// 0x3e - Invalid token program + #[error("Invalid token program")] + InvalidTokenProgram, + /// 0x3f - Data type mismatch + #[error("Data type mismatch")] + DataTypeMismatch, + /// 0x40 - + #[error("")] + BeyondAlottedAddressSize, + /// 0x41 - + #[error("")] + ReservationNotComplete, + /// 0x42 - + #[error("")] + TriedToReplaceAnExistingReservation, + /// 0x43 - Invalid operation + #[error("Invalid operation")] + InvalidOperation, + /// 0x44 - Invalid Owner + #[error("Invalid Owner")] + InvalidOwner, + /// 0x45 - Printing mint supply must be zero for conversion + #[error("Printing mint supply must be zero for conversion")] + PrintingMintSupplyMustBeZeroForConversion, + /// 0x46 - One Time Auth mint supply must be zero for conversion + #[error("One Time Auth mint supply must be zero for conversion")] + OneTimeAuthMintSupplyMustBeZeroForConversion, + /// 0x47 - You tried to insert one edition too many into an edition mark pda + #[error("You tried to insert one edition too many into an edition mark pda")] + InvalidEditionIndex, + /// 0x48 - + #[error("")] + ReservationArrayShouldBeSizeOne, + /// 0x49 - Is Mutable can only be flipped to false + #[error("Is Mutable can only be flipped to false")] + IsMutableCanOnlyBeFlippedToFalse, + /// 0x4a - Collection cannot be verified in this instruction + #[error("Collection cannot be verified in this instruction")] + CollectionCannotBeVerifiedInThisInstruction, + /// 0x4b - This instruction was deprecated in a previous release and is now removed + #[error("This instruction was deprecated in a previous release and is now removed")] + Removed, + /// 0x4c - + #[error("")] + MustBeBurned, + /// 0x4d - This use method is invalid + #[error("This use method is invalid")] + InvalidUseMethod, + /// 0x4e - Cannot Change Use Method after the first use + #[error("Cannot Change Use Method after the first use")] + CannotChangeUseMethodAfterFirstUse, + /// 0x4f - Cannot Change Remaining or Available uses after the first use + #[error("Cannot Change Remaining or Available uses after the first use")] + CannotChangeUsesAfterFirstUse, + /// 0x50 - Collection Not Found on Metadata + #[error("Collection Not Found on Metadata")] + CollectionNotFound, + /// 0x51 - Collection Update Authority is invalid + #[error("Collection Update Authority is invalid")] + InvalidCollectionUpdateAuthority, + /// 0x52 - Collection Must Be a Unique Master Edition v2 + #[error("Collection Must Be a Unique Master Edition v2")] + CollectionMustBeAUniqueMasterEdition, + /// 0x53 - The Use Authority Record Already Exists, to modify it Revoke, then Approve + #[error("The Use Authority Record Already Exists, to modify it Revoke, then Approve")] + UseAuthorityRecordAlreadyExists, + /// 0x54 - The Use Authority Record is empty or already revoked + #[error("The Use Authority Record is empty or already revoked")] + UseAuthorityRecordAlreadyRevoked, + /// 0x55 - This token has no uses + #[error("This token has no uses")] + Unusable, + /// 0x56 - There are not enough Uses left on this token. + #[error("There are not enough Uses left on this token.")] + NotEnoughUses, + /// 0x57 - This Collection Authority Record Already Exists. + #[error("This Collection Authority Record Already Exists.")] + CollectionAuthorityRecordAlreadyExists, + /// 0x58 - This Collection Authority Record Does Not Exist. + #[error("This Collection Authority Record Does Not Exist.")] + CollectionAuthorityDoesNotExist, + /// 0x59 - This Use Authority Record is invalid. + #[error("This Use Authority Record is invalid.")] + InvalidUseAuthorityRecord, + /// 0x5a - + #[error("")] + InvalidCollectionAuthorityRecord, + /// 0x5b - Metadata does not match the freeze authority on the mint + #[error("Metadata does not match the freeze authority on the mint")] + InvalidFreezeAuthority, + /// 0x5c - All tokens in this account have not been delegated to this user. + #[error("All tokens in this account have not been delegated to this user.")] + InvalidDelegate, + /// 0x5d - + #[error("")] + CannotAdjustVerifiedCreator, + /// 0x5e - Verified creators cannot be removed. + #[error("Verified creators cannot be removed.")] + CannotRemoveVerifiedCreator, + /// 0x5f - + #[error("")] + CannotWipeVerifiedCreators, + /// 0x60 - + #[error("")] + NotAllowedToChangeSellerFeeBasisPoints, + /// 0x61 - Edition override cannot be zero + #[error("Edition override cannot be zero")] + EditionOverrideCannotBeZero, + /// 0x62 - Invalid User + #[error("Invalid User")] + InvalidUser, + /// 0x63 - Revoke Collection Authority signer is incorrect + #[error("Revoke Collection Authority signer is incorrect")] + RevokeCollectionAuthoritySignerIncorrect, + /// 0x64 - + #[error("")] + TokenCloseFailed, + /// 0x65 - Can't use this function on unsized collection + #[error("Can't use this function on unsized collection")] + UnsizedCollection, + /// 0x66 - Can't use this function on a sized collection + #[error("Can't use this function on a sized collection")] + SizedCollection, + /// 0x67 - Missing collection metadata account + #[error("Missing collection metadata account")] + MissingCollectionMetadata, + /// 0x68 - This NFT is not a member of the specified collection. + #[error("This NFT is not a member of the specified collection.")] + NotAMemberOfCollection, + /// 0x69 - This NFT is not a verified member of the specified collection. + #[error("This NFT is not a verified member of the specified collection.")] + NotVerifiedMemberOfCollection, + /// 0x6a - This NFT is not a collection parent NFT. + #[error("This NFT is not a collection parent NFT.")] + NotACollectionParent, + /// 0x6b - Could not determine a TokenStandard type. + #[error("Could not determine a TokenStandard type.")] + CouldNotDetermineTokenStandard, + /// 0x6c - This mint account has an edition but none was provided. + #[error("This mint account has an edition but none was provided.")] + MissingEditionAccount, + /// 0x6d - This edition is not a Master Edition + #[error("This edition is not a Master Edition")] + NotAMasterEdition, + /// 0x6e - This Master Edition has existing prints + #[error("This Master Edition has existing prints")] + MasterEditionHasPrints, + /// 0x6f - + #[error("")] + BorshDeserializationError, + /// 0x70 - Cannot update a verified collection in this command + #[error("Cannot update a verified collection in this command")] + CannotUpdateVerifiedCollection, + /// 0x71 - Edition account doesnt match collection + #[error("Edition account doesnt match collection ")] + CollectionMasterEditionAccountInvalid, + /// 0x72 - Item is already verified. + #[error("Item is already verified.")] + AlreadyVerified, + /// 0x73 - + #[error("")] + AlreadyUnverified, + /// 0x74 - This edition is not a Print Edition + #[error("This edition is not a Print Edition")] + NotAPrintEdition, + /// 0x75 - Invalid Master Edition + #[error("Invalid Master Edition")] + InvalidMasterEdition, + /// 0x76 - Invalid Print Edition + #[error("Invalid Print Edition")] + InvalidPrintEdition, + /// 0x77 - Invalid Edition Marker + #[error("Invalid Edition Marker")] + InvalidEditionMarker, + /// 0x78 - Reservation List is Deprecated + #[error("Reservation List is Deprecated")] + ReservationListDeprecated, + /// 0x79 - Print Edition does not match Master Edition + #[error("Print Edition does not match Master Edition")] + PrintEditionDoesNotMatchMasterEdition, + /// 0x7a - Edition Number greater than max supply + #[error("Edition Number greater than max supply")] + EditionNumberGreaterThanMaxSupply, + /// 0x7b - Must unverify before migrating collections. + #[error("Must unverify before migrating collections.")] + MustUnverify, + /// 0x7c - Invalid Escrow Account Bump Seed + #[error("Invalid Escrow Account Bump Seed")] + InvalidEscrowBumpSeed, + /// 0x7d - Must Escrow Authority + #[error("Must Escrow Authority")] + MustBeEscrowAuthority, + /// 0x7e - Invalid System Program + #[error("Invalid System Program")] + InvalidSystemProgram, + /// 0x7f - Must be a Non Fungible Token + #[error("Must be a Non Fungible Token")] + MustBeNonFungible, + /// 0x80 - Insufficient tokens for transfer + #[error("Insufficient tokens for transfer")] + InsufficientTokens, + /// 0x81 - Borsh Serialization Error + #[error("Borsh Serialization Error")] + BorshSerializationError, + /// 0x82 - Cannot create NFT with no Freeze Authority. + #[error("Cannot create NFT with no Freeze Authority.")] + NoFreezeAuthoritySet, + /// 0x83 - Invalid collection size change + #[error("Invalid collection size change")] + InvalidCollectionSizeChange, + /// 0x84 - Invalid bubblegum signer + #[error("Invalid bubblegum signer")] + InvalidBubblegumSigner, + /// 0x85 - Escrow parent cannot have a delegate + #[error("Escrow parent cannot have a delegate")] + EscrowParentHasDelegate, + /// 0x86 - Mint needs to be signer to initialize the account + #[error("Mint needs to be signer to initialize the account")] + MintIsNotSigner, + /// 0x87 - Invalid token standard + #[error("Invalid token standard")] + InvalidTokenStandard, + /// 0x88 - Invalid mint account for specified token standard + #[error("Invalid mint account for specified token standard")] + InvalidMintForTokenStandard, + /// 0x89 - Invalid authorization rules account + #[error("Invalid authorization rules account")] + InvalidAuthorizationRules, + /// 0x8a - Missing authorization rules account + #[error("Missing authorization rules account")] + MissingAuthorizationRules, + /// 0x8b - Missing programmable configuration + #[error("Missing programmable configuration")] + MissingProgrammableConfig, + /// 0x8c - Invalid programmable configuration + #[error("Invalid programmable configuration")] + InvalidProgrammableConfig, + /// 0x8d - Delegate already exists + #[error("Delegate already exists")] + DelegateAlreadyExists, + /// 0x8e - Delegate not found + #[error("Delegate not found")] + DelegateNotFound, + /// 0x8f - Required account not set in instruction builder + #[error("Required account not set in instruction builder")] + MissingAccountInBuilder, + /// 0x90 - Required argument not set in instruction builder + #[error("Required argument not set in instruction builder")] + MissingArgumentInBuilder, + /// 0x91 - Feature not supported currently + #[error("Feature not supported currently")] + FeatureNotSupported, + /// 0x92 - Invalid system wallet + #[error("Invalid system wallet")] + InvalidSystemWallet, + /// 0x93 - Only the sale delegate can transfer while its set + #[error("Only the sale delegate can transfer while its set")] + OnlySaleDelegateCanTransfer, + /// 0x94 - Missing token account + #[error("Missing token account")] + MissingTokenAccount, + /// 0x95 - Missing SPL token program + #[error("Missing SPL token program")] + MissingSplTokenProgram, + /// 0x96 - Missing authorization rules program + #[error("Missing authorization rules program")] + MissingAuthorizationRulesProgram, + /// 0x97 - Invalid delegate role for transfer + #[error("Invalid delegate role for transfer")] + InvalidDelegateRoleForTransfer, + /// 0x98 - Invalid transfer authority + #[error("Invalid transfer authority")] + InvalidTransferAuthority, + /// 0x99 - Instruction not supported for ProgrammableNonFungible assets + #[error("Instruction not supported for ProgrammableNonFungible assets")] + InstructionNotSupported, + /// 0x9a - Public key does not match expected value + #[error("Public key does not match expected value")] + KeyMismatch, + /// 0x9b - Token is locked + #[error("Token is locked")] + LockedToken, + /// 0x9c - Token is unlocked + #[error("Token is unlocked")] + UnlockedToken, + /// 0x9d - Missing delegate role + #[error("Missing delegate role")] + MissingDelegateRole, + /// 0x9e - Invalid authority type + #[error("Invalid authority type")] + InvalidAuthorityType, + /// 0x9f - Missing token record account + #[error("Missing token record account")] + MissingTokenRecord, + /// 0xa0 - Mint supply must be zero for programmable assets + #[error("Mint supply must be zero for programmable assets")] + MintSupplyMustBeZero, + /// 0xa1 - Data is empty or zeroed + #[error("Data is empty or zeroed")] + DataIsEmptyOrZeroed, + /// 0xa2 - Missing token owner + #[error("Missing token owner")] + MissingTokenOwnerAccount, + /// 0xa3 - Master edition account has an invalid length + #[error("Master edition account has an invalid length")] + InvalidMasterEditionAccountLength, + /// 0xa4 - Incorrect token state + #[error("Incorrect token state")] + IncorrectTokenState, + /// 0xa5 - Invalid delegate role + #[error("Invalid delegate role")] + InvalidDelegateRole, + /// 0xa6 - Print supply is required for non-fungibles + #[error("Print supply is required for non-fungibles")] + MissingPrintSupply, + /// 0xa7 - Missing master edition account + #[error("Missing master edition account")] + MissingMasterEditionAccount, + /// 0xa8 - Amount must be greater than zero + #[error("Amount must be greater than zero")] + AmountMustBeGreaterThanZero, + /// 0xa9 - Invalid delegate args + #[error("Invalid delegate args")] + InvalidDelegateArgs, + /// 0xaa - Missing address for locked transfer + #[error("Missing address for locked transfer")] + MissingLockedTransferAddress, + /// 0xab - Invalid destination address for locked transfer + #[error("Invalid destination address for locked transfer")] + InvalidLockedTransferAddress, + /// 0xac - Exceeded account realloc increase limit + #[error("Exceeded account realloc increase limit")] + DataIncrementLimitExceeded, + /// 0xad - Cannot update the rule set of a programmable asset that has a delegate + #[error("Cannot update the rule set of a programmable asset that has a delegate")] + CannotUpdateAssetWithDelegate, + /// 0xae - Invalid token amount for this operation or token standard + #[error("Invalid token amount for this operation or token standard")] + InvalidAmount, + /// 0xaf - Missing master edition mint account + #[error("Missing master edition mint account")] + MissingMasterEditionMintAccount, + /// 0xb0 - Missing master edition token account + #[error("Missing master edition token account")] + MissingMasterEditionTokenAccount, + /// 0xb1 - Missing edition marker account + #[error("Missing edition marker account")] + MissingEditionMarkerAccount, + /// 0xb2 - Cannot burn while persistent delegate is set + #[error("Cannot burn while persistent delegate is set")] + CannotBurnWithDelegate, + /// 0xb3 - Missing edition account + #[error("Missing edition account")] + MissingEdition, + /// 0xb4 - Invalid Associated Token Account Program + #[error("Invalid Associated Token Account Program")] + InvalidAssociatedTokenAccountProgram, + /// 0xb5 - Invalid InstructionsSysvar + #[error("Invalid InstructionsSysvar")] + InvalidInstructionsSysvar, + /// 0xb6 - Invalid or Unneeded parent accounts + #[error("Invalid or Unneeded parent accounts")] + InvalidParentAccounts, + /// 0xb7 - Authority cannot apply all update args + #[error("Authority cannot apply all update args")] + InvalidUpdateArgs, + /// 0xb8 - Token account does not have enough tokens + #[error("Token account does not have enough tokens")] + InsufficientTokenBalance, + /// 0xb9 - Missing collection account + #[error("Missing collection account")] + MissingCollectionMint, + /// 0xba - Missing collection master edition account + #[error("Missing collection master edition account")] + MissingCollectionMasterEdition, + /// 0xbb - Invalid token record account + #[error("Invalid token record account")] + InvalidTokenRecord, + /// 0xbc - The close authority needs to be revoked by the Utility Delegate + #[error("The close authority needs to be revoked by the Utility Delegate")] + InvalidCloseAuthority, + /// 0xbd - Invalid or removed instruction + #[error("Invalid or removed instruction")] + InvalidInstruction, + /// 0xbe - Missing delegate record + #[error("Missing delegate record")] + MissingDelegateRecord, + /// 0xbf - + #[error("")] + InvalidFeeAccount, + /// 0xc0 - + #[error("")] + InvalidMetadataFlags, +} diff --git a/clients/rust/src/generated/instructions/approve_collection_authority.rs b/clients/rust/src/generated/instructions/approve_collection_authority.rs new file mode 100644 index 00000000..d6155b36 --- /dev/null +++ b/clients/rust/src/generated/instructions/approve_collection_authority.rs @@ -0,0 +1,387 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct ApproveCollectionAuthority { + /// Collection Authority Record PDA + pub collection_authority_record: solana_program::pubkey::Pubkey, + /// A Collection Authority + pub new_collection_authority: solana_program::pubkey::Pubkey, + /// Update Authority of Collection NFT + pub update_authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// Collection Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of Collection Metadata + pub mint: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl ApproveCollectionAuthority { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = ApproveCollectionAuthorityInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority_record, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.new_collection_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.update_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct ApproveCollectionAuthorityInstructionArgs { + discriminator: u8, +} + +impl ApproveCollectionAuthorityInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 23 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct ApproveCollectionAuthorityBuilder { + collection_authority_record: Option, + new_collection_authority: Option, + update_authority: Option, + payer: Option, + metadata: Option, + mint: Option, + system_program: Option, + rent: Option, +} + +impl ApproveCollectionAuthorityBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + pub fn new_collection_authority( + &mut self, + new_collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.new_collection_authority = Some(new_collection_authority); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = ApproveCollectionAuthority { + collection_authority_record: self + .collection_authority_record + .expect("collection_authority_record is not set"), + new_collection_authority: self + .new_collection_authority + .expect("new_collection_authority is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + payer: self.payer.expect("payer is not set"), + metadata: self.metadata.expect("metadata is not set"), + mint: self.mint.expect("mint is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + + accounts.instruction() + } +} + +/// `approve_collection_authority` CPI instruction. +pub struct ApproveCollectionAuthorityCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + /// A Collection Authority + pub new_collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Update Authority of Collection NFT + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of Collection Metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> ApproveCollectionAuthorityCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = ApproveCollectionAuthorityInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority_record.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.new_collection_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.update_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(8 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.collection_authority_record.clone()); + account_infos.push(self.new_collection_authority.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `approve_collection_authority` CPI instruction builder. +pub struct ApproveCollectionAuthorityCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(ApproveCollectionAuthorityCpiBuilderInstruction { + __program: program, + collection_authority_record: None, + new_collection_authority: None, + update_authority: None, + payer: None, + metadata: None, + mint: None, + system_program: None, + rent: None, + }); + Self { instruction } + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + pub fn new_collection_authority( + &mut self, + new_collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_collection_authority = Some(new_collection_authority); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> ApproveCollectionAuthorityCpi<'a> { + ApproveCollectionAuthorityCpi { + __program: self.instruction.__program, + + collection_authority_record: self + .instruction + .collection_authority_record + .expect("collection_authority_record is not set"), + + new_collection_authority: self + .instruction + .new_collection_authority + .expect("new_collection_authority is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + } + } +} + +struct ApproveCollectionAuthorityCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/approve_use_authority.rs b/clients/rust/src/generated/instructions/approve_use_authority.rs new file mode 100644 index 00000000..1cbc2b52 --- /dev/null +++ b/clients/rust/src/generated/instructions/approve_use_authority.rs @@ -0,0 +1,497 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct ApproveUseAuthority { + /// Use Authority Record PDA + pub use_authority_record: solana_program::pubkey::Pubkey, + /// Owner + pub owner: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// A Use Authority + pub user: solana_program::pubkey::Pubkey, + /// Owned Token Account Of Mint + pub owner_token_account: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of Metadata + pub mint: solana_program::pubkey::Pubkey, + /// Program As Signer (Burner) + pub burner: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl ApproveUseAuthority { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: ApproveUseAuthorityInstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new( + self.use_authority_record, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.owner, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.user, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.owner_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.burner, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct ApproveUseAuthorityInstructionArgs { + discriminator: u8, + pub number_of_uses: u64, +} + +impl ApproveUseAuthorityInstructionArgs { + pub fn new(number_of_uses: u64) -> Self { + Self { + discriminator: 20, + number_of_uses, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct ApproveUseAuthorityBuilder { + use_authority_record: Option, + owner: Option, + payer: Option, + user: Option, + owner_token_account: Option, + metadata: Option, + mint: Option, + burner: Option, + token_program: Option, + system_program: Option, + rent: Option, + number_of_uses: Option, +} + +impl ApproveUseAuthorityBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn use_authority_record( + &mut self, + use_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.use_authority_record = Some(use_authority_record); + self + } + pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.owner = Some(owner); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self { + self.user = Some(user); + self + } + pub fn owner_token_account( + &mut self, + owner_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.owner_token_account = Some(owner_token_account); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn burner(&mut self, burner: solana_program::pubkey::Pubkey) -> &mut Self { + self.burner = Some(burner); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { + self.number_of_uses = Some(number_of_uses); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = ApproveUseAuthority { + use_authority_record: self + .use_authority_record + .expect("use_authority_record is not set"), + owner: self.owner.expect("owner is not set"), + payer: self.payer.expect("payer is not set"), + user: self.user.expect("user is not set"), + owner_token_account: self + .owner_token_account + .expect("owner_token_account is not set"), + metadata: self.metadata.expect("metadata is not set"), + mint: self.mint.expect("mint is not set"), + burner: self.burner.expect("burner is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + let args = ApproveUseAuthorityInstructionArgs::new( + self.number_of_uses + .clone() + .expect("number_of_uses is not set"), + ); + + accounts.instruction(args) + } +} + +/// `approve_use_authority` CPI instruction. +pub struct ApproveUseAuthorityCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Use Authority Record PDA + pub use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + /// Owner + pub owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// A Use Authority + pub user: &'a solana_program::account_info::AccountInfo<'a>, + /// Owned Token Account Of Mint + pub owner_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of Metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Program As Signer (Burner) + pub burner: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: ApproveUseAuthorityInstructionArgs, +} + +impl<'a> ApproveUseAuthorityCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.use_authority_record.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.user.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.owner_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.burner.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.use_authority_record.clone()); + account_infos.push(self.owner.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.user.clone()); + account_infos.push(self.owner_token_account.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.burner.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `approve_use_authority` CPI instruction builder. +pub struct ApproveUseAuthorityCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> ApproveUseAuthorityCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(ApproveUseAuthorityCpiBuilderInstruction { + __program: program, + use_authority_record: None, + owner: None, + payer: None, + user: None, + owner_token_account: None, + metadata: None, + mint: None, + burner: None, + token_program: None, + system_program: None, + rent: None, + number_of_uses: None, + }); + Self { instruction } + } + pub fn use_authority_record( + &mut self, + use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.use_authority_record = Some(use_authority_record); + self + } + pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.owner = Some(owner); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn user(&mut self, user: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.user = Some(user); + self + } + pub fn owner_token_account( + &mut self, + owner_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.owner_token_account = Some(owner_token_account); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn burner( + &mut self, + burner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.burner = Some(burner); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { + self.instruction.number_of_uses = Some(number_of_uses); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> ApproveUseAuthorityCpi<'a> { + let args = ApproveUseAuthorityInstructionArgs::new( + self.instruction + .number_of_uses + .clone() + .expect("number_of_uses is not set"), + ); + + ApproveUseAuthorityCpi { + __program: self.instruction.__program, + + use_authority_record: self + .instruction + .use_authority_record + .expect("use_authority_record is not set"), + + owner: self.instruction.owner.expect("owner is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + user: self.instruction.user.expect("user is not set"), + + owner_token_account: self + .instruction + .owner_token_account + .expect("owner_token_account is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + burner: self.instruction.burner.expect("burner is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + __args: args, + } + } +} + +struct ApproveUseAuthorityCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + use_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + user: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + burner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + number_of_uses: Option, +} diff --git a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs new file mode 100644 index 00000000..1f4702f1 --- /dev/null +++ b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs @@ -0,0 +1,350 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::SetCollectionSizeArgs; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct BubblegumSetCollectionSize { + /// Collection Metadata account + pub collection_metadata: solana_program::pubkey::Pubkey, + /// Collection Update authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Signing PDA of Bubblegum program + pub bubblegum_signer: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl BubblegumSetCollectionSize { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: BubblegumSetCollectionSizeInstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.bubblegum_signer, + true, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct BubblegumSetCollectionSizeInstructionArgs { + discriminator: u8, + pub set_collection_size_args: SetCollectionSizeArgs, +} + +impl BubblegumSetCollectionSizeInstructionArgs { + pub fn new(set_collection_size_args: SetCollectionSizeArgs) -> Self { + Self { + discriminator: 36, + set_collection_size_args, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct BubblegumSetCollectionSizeBuilder { + collection_metadata: Option, + collection_authority: Option, + collection_mint: Option, + bubblegum_signer: Option, + collection_authority_record: Option, + set_collection_size_args: Option, +} + +impl BubblegumSetCollectionSizeBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn bubblegum_signer( + &mut self, + bubblegum_signer: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.bubblegum_signer = Some(bubblegum_signer); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + pub fn set_collection_size_args( + &mut self, + set_collection_size_args: SetCollectionSizeArgs, + ) -> &mut Self { + self.set_collection_size_args = Some(set_collection_size_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = BubblegumSetCollectionSize { + collection_metadata: self + .collection_metadata + .expect("collection_metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + bubblegum_signer: self.bubblegum_signer.expect("bubblegum_signer is not set"), + collection_authority_record: self.collection_authority_record, + }; + let args = BubblegumSetCollectionSizeInstructionArgs::new( + self.set_collection_size_args + .clone() + .expect("set_collection_size_args is not set"), + ); + + accounts.instruction(args) + } +} + +/// `bubblegum_set_collection_size` CPI instruction. +pub struct BubblegumSetCollectionSizeCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Metadata account + pub collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Update authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Signing PDA of Bubblegum program + pub bubblegum_signer: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: BubblegumSetCollectionSizeInstructionArgs, +} + +impl<'a> BubblegumSetCollectionSizeCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.bubblegum_signer.key, + true, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(5 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.collection_metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.bubblegum_signer.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `bubblegum_set_collection_size` CPI instruction builder. +pub struct BubblegumSetCollectionSizeCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(BubblegumSetCollectionSizeCpiBuilderInstruction { + __program: program, + collection_metadata: None, + collection_authority: None, + collection_mint: None, + bubblegum_signer: None, + collection_authority_record: None, + set_collection_size_args: None, + }); + Self { instruction } + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn bubblegum_signer( + &mut self, + bubblegum_signer: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.bubblegum_signer = Some(bubblegum_signer); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + pub fn set_collection_size_args( + &mut self, + set_collection_size_args: SetCollectionSizeArgs, + ) -> &mut Self { + self.instruction.set_collection_size_args = Some(set_collection_size_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> BubblegumSetCollectionSizeCpi<'a> { + let args = BubblegumSetCollectionSizeInstructionArgs::new( + self.instruction + .set_collection_size_args + .clone() + .expect("set_collection_size_args is not set"), + ); + + BubblegumSetCollectionSizeCpi { + __program: self.instruction.__program, + + collection_metadata: self + .instruction + .collection_metadata + .expect("collection_metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + bubblegum_signer: self + .instruction + .bubblegum_signer + .expect("bubblegum_signer is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + __args: args, + } + } +} + +struct BubblegumSetCollectionSizeCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + bubblegum_signer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + set_collection_size_args: Option, +} diff --git a/clients/rust/src/generated/instructions/burn_edition_nft.rs b/clients/rust/src/generated/instructions/burn_edition_nft.rs new file mode 100644 index 00000000..b939f92f --- /dev/null +++ b/clients/rust/src/generated/instructions/burn_edition_nft.rs @@ -0,0 +1,477 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct BurnEditionNft { + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// NFT owner + pub owner: solana_program::pubkey::Pubkey, + /// Mint of the print edition NFT + pub print_edition_mint: solana_program::pubkey::Pubkey, + /// Mint of the original/master NFT + pub master_edition_mint: solana_program::pubkey::Pubkey, + /// Token account the print edition NFT is in + pub print_edition_token_account: solana_program::pubkey::Pubkey, + /// Token account the Master Edition NFT is in + pub master_edition_token_account: solana_program::pubkey::Pubkey, + /// MasterEdition2 of the original NFT + pub master_edition_account: solana_program::pubkey::Pubkey, + /// Print Edition account of the NFT + pub print_edition_account: solana_program::pubkey::Pubkey, + /// Edition Marker PDA of the NFT + pub edition_marker_account: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: solana_program::pubkey::Pubkey, +} + +impl BurnEditionNft { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = BurnEditionNftInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(10); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.owner, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.print_edition_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_edition_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.print_edition_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_edition_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.print_edition_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_marker_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct BurnEditionNftInstructionArgs { + discriminator: u8, +} + +impl BurnEditionNftInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 37 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct BurnEditionNftBuilder { + metadata: Option, + owner: Option, + print_edition_mint: Option, + master_edition_mint: Option, + print_edition_token_account: Option, + master_edition_token_account: Option, + master_edition_account: Option, + print_edition_account: Option, + edition_marker_account: Option, + spl_token_program: Option, +} + +impl BurnEditionNftBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.owner = Some(owner); + self + } + pub fn print_edition_mint( + &mut self, + print_edition_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.print_edition_mint = Some(print_edition_mint); + self + } + pub fn master_edition_mint( + &mut self, + master_edition_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_edition_mint = Some(master_edition_mint); + self + } + pub fn print_edition_token_account( + &mut self, + print_edition_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.print_edition_token_account = Some(print_edition_token_account); + self + } + pub fn master_edition_token_account( + &mut self, + master_edition_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_edition_token_account = Some(master_edition_token_account); + self + } + pub fn master_edition_account( + &mut self, + master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_edition_account = Some(master_edition_account); + self + } + pub fn print_edition_account( + &mut self, + print_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.print_edition_account = Some(print_edition_account); + self + } + pub fn edition_marker_account( + &mut self, + edition_marker_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_marker_account = Some(edition_marker_account); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = BurnEditionNft { + metadata: self.metadata.expect("metadata is not set"), + owner: self.owner.expect("owner is not set"), + print_edition_mint: self + .print_edition_mint + .expect("print_edition_mint is not set"), + master_edition_mint: self + .master_edition_mint + .expect("master_edition_mint is not set"), + print_edition_token_account: self + .print_edition_token_account + .expect("print_edition_token_account is not set"), + master_edition_token_account: self + .master_edition_token_account + .expect("master_edition_token_account is not set"), + master_edition_account: self + .master_edition_account + .expect("master_edition_account is not set"), + print_edition_account: self + .print_edition_account + .expect("print_edition_account is not set"), + edition_marker_account: self + .edition_marker_account + .expect("edition_marker_account is not set"), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + }; + + accounts.instruction() + } +} + +/// `burn_edition_nft` CPI instruction. +pub struct BurnEditionNftCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// NFT owner + pub owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the print edition NFT + pub print_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the original/master NFT + pub master_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account the print edition NFT is in + pub print_edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account the Master Edition NFT is in + pub master_edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 of the original NFT + pub master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Print Edition account of the NFT + pub print_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition Marker PDA of the NFT + pub edition_marker_account: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> BurnEditionNftCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = BurnEditionNftInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(10); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.print_edition_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_edition_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.print_edition_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_edition_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.print_edition_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_marker_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(10 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.owner.clone()); + account_infos.push(self.print_edition_mint.clone()); + account_infos.push(self.master_edition_mint.clone()); + account_infos.push(self.print_edition_token_account.clone()); + account_infos.push(self.master_edition_token_account.clone()); + account_infos.push(self.master_edition_account.clone()); + account_infos.push(self.print_edition_account.clone()); + account_infos.push(self.edition_marker_account.clone()); + account_infos.push(self.spl_token_program.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `burn_edition_nft` CPI instruction builder. +pub struct BurnEditionNftCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> BurnEditionNftCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(BurnEditionNftCpiBuilderInstruction { + __program: program, + metadata: None, + owner: None, + print_edition_mint: None, + master_edition_mint: None, + print_edition_token_account: None, + master_edition_token_account: None, + master_edition_account: None, + print_edition_account: None, + edition_marker_account: None, + spl_token_program: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.owner = Some(owner); + self + } + pub fn print_edition_mint( + &mut self, + print_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.print_edition_mint = Some(print_edition_mint); + self + } + pub fn master_edition_mint( + &mut self, + master_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition_mint = Some(master_edition_mint); + self + } + pub fn print_edition_token_account( + &mut self, + print_edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.print_edition_token_account = Some(print_edition_token_account); + self + } + pub fn master_edition_token_account( + &mut self, + master_edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition_token_account = Some(master_edition_token_account); + self + } + pub fn master_edition_account( + &mut self, + master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition_account = Some(master_edition_account); + self + } + pub fn print_edition_account( + &mut self, + print_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.print_edition_account = Some(print_edition_account); + self + } + pub fn edition_marker_account( + &mut self, + edition_marker_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_marker_account = Some(edition_marker_account); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> BurnEditionNftCpi<'a> { + BurnEditionNftCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + owner: self.instruction.owner.expect("owner is not set"), + + print_edition_mint: self + .instruction + .print_edition_mint + .expect("print_edition_mint is not set"), + + master_edition_mint: self + .instruction + .master_edition_mint + .expect("master_edition_mint is not set"), + + print_edition_token_account: self + .instruction + .print_edition_token_account + .expect("print_edition_token_account is not set"), + + master_edition_token_account: self + .instruction + .master_edition_token_account + .expect("master_edition_token_account is not set"), + + master_edition_account: self + .instruction + .master_edition_account + .expect("master_edition_account is not set"), + + print_edition_account: self + .instruction + .print_edition_account + .expect("print_edition_account is not set"), + + edition_marker_account: self + .instruction + .edition_marker_account + .expect("edition_marker_account is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + } + } +} + +struct BurnEditionNftCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + print_edition_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + print_edition_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + print_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_marker_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/burn_nft.rs b/clients/rust/src/generated/instructions/burn_nft.rs new file mode 100644 index 00000000..4a71a752 --- /dev/null +++ b/clients/rust/src/generated/instructions/burn_nft.rs @@ -0,0 +1,357 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct BurnNft { + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// NFT owner + pub owner: solana_program::pubkey::Pubkey, + /// Mint of the NFT + pub mint: solana_program::pubkey::Pubkey, + /// Token account to close + pub token_account: solana_program::pubkey::Pubkey, + /// MasterEdition2 of the NFT + pub master_edition_account: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: solana_program::pubkey::Pubkey, + /// Metadata of the Collection + pub collection_metadata: Option, +} + +impl BurnNft { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = BurnNftInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.owner, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + collection_metadata, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct BurnNftInstructionArgs { + discriminator: u8, +} + +impl BurnNftInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 29 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct BurnNftBuilder { + metadata: Option, + owner: Option, + mint: Option, + token_account: Option, + master_edition_account: Option, + spl_token_program: Option, + collection_metadata: Option, +} + +impl BurnNftBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.owner = Some(owner); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn master_edition_account( + &mut self, + master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_edition_account = Some(master_edition_account); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = BurnNft { + metadata: self.metadata.expect("metadata is not set"), + owner: self.owner.expect("owner is not set"), + mint: self.mint.expect("mint is not set"), + token_account: self.token_account.expect("token_account is not set"), + master_edition_account: self + .master_edition_account + .expect("master_edition_account is not set"), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + collection_metadata: self.collection_metadata, + }; + + accounts.instruction() + } +} + +/// `burn_nft` CPI instruction. +pub struct BurnNftCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// NFT owner + pub owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the NFT + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account to close + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 of the NFT + pub master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata of the Collection + pub collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> BurnNftCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = BurnNftInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + *collection_metadata.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.owner.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.master_edition_account.clone()); + account_infos.push(self.spl_token_program.clone()); + if let Some(collection_metadata) = self.collection_metadata { + account_infos.push(collection_metadata.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `burn_nft` CPI instruction builder. +pub struct BurnNftCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> BurnNftCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(BurnNftCpiBuilderInstruction { + __program: program, + metadata: None, + owner: None, + mint: None, + token_account: None, + master_edition_account: None, + spl_token_program: None, + collection_metadata: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.owner = Some(owner); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn master_edition_account( + &mut self, + master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition_account = Some(master_edition_account); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> BurnNftCpi<'a> { + BurnNftCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + owner: self.instruction.owner.expect("owner is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + master_edition_account: self + .instruction + .master_edition_account + .expect("master_edition_account is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + + collection_metadata: self.instruction.collection_metadata, + } + } +} + +struct BurnNftCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/burn_v1.rs b/clients/rust/src/generated/instructions/burn_v1.rs new file mode 100644 index 00000000..6f38640e --- /dev/null +++ b/clients/rust/src/generated/instructions/burn_v1.rs @@ -0,0 +1,672 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct BurnV1 { + /// Asset owner or Utility delegate + pub authority: solana_program::pubkey::Pubkey, + /// Metadata of the Collection + pub collection_metadata: Option, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Edition of the asset + pub edition: Option, + /// Mint of token asset + pub mint: solana_program::pubkey::Pubkey, + /// Token account to close + pub token: solana_program::pubkey::Pubkey, + /// Master edition account + pub master_edition: Option, + /// Master edition mint of the asset + pub master_edition_mint: Option, + /// Master edition token account + pub master_edition_token: Option, + /// Edition marker account + pub edition_marker: Option, + /// Token record account + pub token_record: Option, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: solana_program::pubkey::Pubkey, +} + +impl BurnV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = BurnV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + accounts.push(solana_program::instruction::AccountMeta::new( + self.authority, + true, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + collection_metadata, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(master_edition_mint) = self.master_edition_mint { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition_mint, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(master_edition_token) = self.master_edition_token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition_token, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(edition_marker) = self.edition_marker { + accounts.push(solana_program::instruction::AccountMeta::new( + edition_marker, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct BurnV1InstructionArgs { + discriminator: u8, + burn_v1_discriminator: u8, + pub amount: u64, +} + +impl BurnV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 41, + burn_v1_discriminator: 0, + amount: 1, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct BurnV1Builder { + authority: Option, + collection_metadata: Option, + metadata: Option, + edition: Option, + mint: Option, + token: Option, + master_edition: Option, + master_edition_mint: Option, + master_edition_token: Option, + edition_marker: Option, + token_record: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + amount: Option, +} + +impl BurnV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn master_edition_mint( + &mut self, + master_edition_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_edition_mint = Some(master_edition_mint); + self + } + pub fn master_edition_token( + &mut self, + master_edition_token: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_edition_token = Some(master_edition_token); + self + } + pub fn edition_marker(&mut self, edition_marker: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition_marker = Some(edition_marker); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = BurnV1 { + authority: self.authority.expect("authority is not set"), + collection_metadata: self.collection_metadata, + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + master_edition: self.master_edition, + master_edition_mint: self.master_edition_mint, + master_edition_token: self.master_edition_token, + edition_marker: self.edition_marker, + token_record: self.token_record, + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + }; + + accounts.instruction() + } +} + +/// `burn_v1` CPI instruction. +pub struct BurnV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Asset owner or Utility delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata of the Collection + pub collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition of the asset + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of token asset + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account to close + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Master edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Master edition mint of the asset + pub master_edition_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Master edition token account + pub master_edition_token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Edition marker account + pub edition_marker: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> BurnV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = BurnV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.authority.key, + true, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + *collection_metadata.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new( + *edition.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new( + *master_edition.key, + false, + )); + } + if let Some(master_edition_mint) = self.master_edition_mint { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition_mint.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(master_edition_token) = self.master_edition_token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition_token.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(edition_marker) = self.edition_marker { + accounts.push(solana_program::instruction::AccountMeta::new( + *edition_marker.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(collection_metadata) = self.collection_metadata { + account_infos.push(collection_metadata.clone()); + } + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(master_edition_mint) = self.master_edition_mint { + account_infos.push(master_edition_mint.clone()); + } + if let Some(master_edition_token) = self.master_edition_token { + account_infos.push(master_edition_token.clone()); + } + if let Some(edition_marker) = self.edition_marker { + account_infos.push(edition_marker.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + account_infos.push(self.spl_token_program.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `burn_v1` CPI instruction builder. +pub struct BurnV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> BurnV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(BurnV1CpiBuilderInstruction { + __program: program, + authority: None, + collection_metadata: None, + metadata: None, + edition: None, + mint: None, + token: None, + master_edition: None, + master_edition_mint: None, + master_edition_token: None, + edition_marker: None, + token_record: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + amount: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn master_edition_mint( + &mut self, + master_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition_mint = Some(master_edition_mint); + self + } + pub fn master_edition_token( + &mut self, + master_edition_token: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition_token = Some(master_edition_token); + self + } + pub fn edition_marker( + &mut self, + edition_marker: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_marker = Some(edition_marker); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> BurnV1Cpi<'a> { + BurnV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + collection_metadata: self.instruction.collection_metadata, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + master_edition: self.instruction.master_edition, + + master_edition_mint: self.instruction.master_edition_mint, + + master_edition_token: self.instruction.master_edition_token, + + edition_marker: self.instruction.edition_marker, + + token_record: self.instruction.token_record, + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + } + } +} + +struct BurnV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition_token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_marker: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, +} diff --git a/clients/rust/src/generated/instructions/close_escrow_account.rs b/clients/rust/src/generated/instructions/close_escrow_account.rs new file mode 100644 index 00000000..a752aad5 --- /dev/null +++ b/clients/rust/src/generated/instructions/close_escrow_account.rs @@ -0,0 +1,365 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct CloseEscrowAccount { + /// Escrow account + pub escrow: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Token account + pub token_account: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: solana_program::pubkey::Pubkey, + /// Wallet paying for the transaction and new account + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, +} + +impl CloseEscrowAccount { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = CloseEscrowAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + self.escrow, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct CloseEscrowAccountInstructionArgs { + discriminator: u8, +} + +impl CloseEscrowAccountInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 39 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct CloseEscrowAccountBuilder { + escrow: Option, + metadata: Option, + mint: Option, + token_account: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, +} + +impl CloseEscrowAccountBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn escrow(&mut self, escrow: solana_program::pubkey::Pubkey) -> &mut Self { + self.escrow = Some(escrow); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = CloseEscrowAccount { + escrow: self.escrow.expect("escrow is not set"), + metadata: self.metadata.expect("metadata is not set"), + mint: self.mint.expect("mint is not set"), + token_account: self.token_account.expect("token_account is not set"), + edition: self.edition.expect("edition is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + }; + + accounts.instruction() + } +} + +/// `close_escrow_account` CPI instruction. +pub struct CloseEscrowAccountCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Escrow account + pub escrow: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Wallet paying for the transaction and new account + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> CloseEscrowAccountCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = CloseEscrowAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.escrow.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(8 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.escrow.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `close_escrow_account` CPI instruction builder. +pub struct CloseEscrowAccountCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> CloseEscrowAccountCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(CloseEscrowAccountCpiBuilderInstruction { + __program: program, + escrow: None, + metadata: None, + mint: None, + token_account: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + }); + Self { instruction } + } + pub fn escrow( + &mut self, + escrow: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.escrow = Some(escrow); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> CloseEscrowAccountCpi<'a> { + CloseEscrowAccountCpi { + __program: self.instruction.__program, + + escrow: self.instruction.escrow.expect("escrow is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + } + } +} + +struct CloseEscrowAccountCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + escrow: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/collect.rs b/clients/rust/src/generated/instructions/collect.rs new file mode 100644 index 00000000..8709c922 --- /dev/null +++ b/clients/rust/src/generated/instructions/collect.rs @@ -0,0 +1,180 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct Collect { + /// Authority to collect fees + pub authority: solana_program::pubkey::Pubkey, + /// PDA to retrieve fees from + pub pda_account: solana_program::pubkey::Pubkey, +} + +impl Collect { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = CollectInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.pda_account, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct CollectInstructionArgs { + discriminator: u8, +} + +impl CollectInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 54 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct CollectBuilder { + authority: Option, + pda_account: Option, +} + +impl CollectBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn pda_account(&mut self, pda_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.pda_account = Some(pda_account); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = Collect { + authority: self.authority.expect("authority is not set"), + pda_account: self.pda_account.expect("pda_account is not set"), + }; + + accounts.instruction() + } +} + +/// `collect` CPI instruction. +pub struct CollectCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Authority to collect fees + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// PDA to retrieve fees from + pub pda_account: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> CollectCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = CollectInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.pda_account.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(2 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.pda_account.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `collect` CPI instruction builder. +pub struct CollectCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> CollectCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(CollectCpiBuilderInstruction { + __program: program, + authority: None, + pda_account: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn pda_account( + &mut self, + pda_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.pda_account = Some(pda_account); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> CollectCpi<'a> { + CollectCpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + pda_account: self + .instruction + .pda_account + .expect("pda_account is not set"), + } + } +} + +struct CollectCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + pda_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs new file mode 100644 index 00000000..7f11c30d --- /dev/null +++ b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs @@ -0,0 +1,216 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct ConvertMasterEditionV1ToV2 { + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: solana_program::pubkey::Pubkey, + /// One time authorization mint + pub one_time_auth: solana_program::pubkey::Pubkey, + /// Printing mint + pub printing_mint: solana_program::pubkey::Pubkey, +} + +impl ConvertMasterEditionV1ToV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = ConvertMasterEditionV1ToV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(3); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.one_time_auth, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.printing_mint, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct ConvertMasterEditionV1ToV2InstructionArgs { + discriminator: u8, +} + +impl ConvertMasterEditionV1ToV2InstructionArgs { + pub fn new() -> Self { + Self { discriminator: 12 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct ConvertMasterEditionV1ToV2Builder { + master_edition: Option, + one_time_auth: Option, + printing_mint: Option, +} + +impl ConvertMasterEditionV1ToV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn one_time_auth(&mut self, one_time_auth: solana_program::pubkey::Pubkey) -> &mut Self { + self.one_time_auth = Some(one_time_auth); + self + } + pub fn printing_mint(&mut self, printing_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.printing_mint = Some(printing_mint); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = ConvertMasterEditionV1ToV2 { + master_edition: self.master_edition.expect("master_edition is not set"), + one_time_auth: self.one_time_auth.expect("one_time_auth is not set"), + printing_mint: self.printing_mint.expect("printing_mint is not set"), + }; + + accounts.instruction() + } +} + +/// `convert_master_edition_v1_to_v2` CPI instruction. +pub struct ConvertMasterEditionV1ToV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// One time authorization mint + pub one_time_auth: &'a solana_program::account_info::AccountInfo<'a>, + /// Printing mint + pub printing_mint: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> ConvertMasterEditionV1ToV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = ConvertMasterEditionV1ToV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(3); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.one_time_auth.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.printing_mint.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(3 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.master_edition.clone()); + account_infos.push(self.one_time_auth.clone()); + account_infos.push(self.printing_mint.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `convert_master_edition_v1_to_v2` CPI instruction builder. +pub struct ConvertMasterEditionV1ToV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> ConvertMasterEditionV1ToV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(ConvertMasterEditionV1ToV2CpiBuilderInstruction { + __program: program, + master_edition: None, + one_time_auth: None, + printing_mint: None, + }); + Self { instruction } + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn one_time_auth( + &mut self, + one_time_auth: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.one_time_auth = Some(one_time_auth); + self + } + pub fn printing_mint( + &mut self, + printing_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.printing_mint = Some(printing_mint); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> ConvertMasterEditionV1ToV2Cpi<'a> { + ConvertMasterEditionV1ToV2Cpi { + __program: self.instruction.__program, + + master_edition: self + .instruction + .master_edition + .expect("master_edition is not set"), + + one_time_auth: self + .instruction + .one_time_auth + .expect("one_time_auth is not set"), + + printing_mint: self + .instruction + .printing_mint + .expect("printing_mint is not set"), + } + } +} + +struct ConvertMasterEditionV1ToV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + one_time_auth: Option<&'a solana_program::account_info::AccountInfo<'a>>, + printing_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/create_escrow_account.rs b/clients/rust/src/generated/instructions/create_escrow_account.rs new file mode 100644 index 00000000..6154f09a --- /dev/null +++ b/clients/rust/src/generated/instructions/create_escrow_account.rs @@ -0,0 +1,410 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct CreateEscrowAccount { + /// Escrow account + pub escrow: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Token account of the token + pub token_account: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: solana_program::pubkey::Pubkey, + /// Wallet paying for the transaction and new account + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Authority/creator of the escrow account + pub authority: Option, +} + +impl CreateEscrowAccount { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = CreateEscrowAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + self.escrow, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authority) = self.authority { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authority, true, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct CreateEscrowAccountInstructionArgs { + discriminator: u8, +} + +impl CreateEscrowAccountInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 38 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct CreateEscrowAccountBuilder { + escrow: Option, + metadata: Option, + mint: Option, + token_account: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authority: Option, +} + +impl CreateEscrowAccountBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn escrow(&mut self, escrow: solana_program::pubkey::Pubkey) -> &mut Self { + self.escrow = Some(escrow); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = CreateEscrowAccount { + escrow: self.escrow.expect("escrow is not set"), + metadata: self.metadata.expect("metadata is not set"), + mint: self.mint.expect("mint is not set"), + token_account: self.token_account.expect("token_account is not set"), + edition: self.edition.expect("edition is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authority: self.authority, + }; + + accounts.instruction() + } +} + +/// `create_escrow_account` CPI instruction. +pub struct CreateEscrowAccountCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Escrow account + pub escrow: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of the token + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Wallet paying for the transaction and new account + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Authority/creator of the escrow account + pub authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> CreateEscrowAccountCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = CreateEscrowAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.escrow.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authority) = self.authority { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authority.key, + true, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(9 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.escrow.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authority) = self.authority { + account_infos.push(authority.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `create_escrow_account` CPI instruction builder. +pub struct CreateEscrowAccountCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> CreateEscrowAccountCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(CreateEscrowAccountCpiBuilderInstruction { + __program: program, + escrow: None, + metadata: None, + mint: None, + token_account: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authority: None, + }); + Self { instruction } + } + pub fn escrow( + &mut self, + escrow: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.escrow = Some(escrow); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> CreateEscrowAccountCpi<'a> { + CreateEscrowAccountCpi { + __program: self.instruction.__program, + + escrow: self.instruction.escrow.expect("escrow is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authority: self.instruction.authority, + } + } +} + +struct CreateEscrowAccountCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + escrow: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/create_master_edition_v3.rs b/clients/rust/src/generated/instructions/create_master_edition_v3.rs new file mode 100644 index 00000000..2fb4da0e --- /dev/null +++ b/clients/rust/src/generated/instructions/create_master_edition_v3.rs @@ -0,0 +1,429 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct CreateMasterEditionV3 { + /// Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition'] + pub edition: solana_program::pubkey::Pubkey, + /// Metadata mint + pub mint: solana_program::pubkey::Pubkey, + /// Update authority + pub update_authority: solana_program::pubkey::Pubkey, + /// Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub mint_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl CreateMasterEditionV3 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: CreateMasterEditionV3InstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateMasterEditionV3InstructionArgs { + discriminator: u8, + pub max_supply: Option, +} + +impl CreateMasterEditionV3InstructionArgs { + pub fn new(max_supply: Option) -> Self { + Self { + discriminator: 17, + max_supply, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct CreateMasterEditionV3Builder { + edition: Option, + mint: Option, + update_authority: Option, + mint_authority: Option, + payer: Option, + metadata: Option, + token_program: Option, + system_program: Option, + rent: Option, + max_supply: Option, +} + +impl CreateMasterEditionV3Builder { + pub fn new() -> Self { + Self::default() + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn mint_authority(&mut self, mint_authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint_authority = Some(mint_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn max_supply(&mut self, max_supply: u64) -> &mut Self { + self.max_supply = Some(max_supply); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = CreateMasterEditionV3 { + edition: self.edition.expect("edition is not set"), + mint: self.mint.expect("mint is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + mint_authority: self.mint_authority.expect("mint_authority is not set"), + payer: self.payer.expect("payer is not set"), + metadata: self.metadata.expect("metadata is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + let args = CreateMasterEditionV3InstructionArgs::new(self.max_supply.clone()); + + accounts.instruction(args) + } +} + +/// `create_master_edition_v3` CPI instruction. +pub struct CreateMasterEditionV3Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition'] + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata mint + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: CreateMasterEditionV3InstructionArgs, +} + +impl<'a> CreateMasterEditionV3Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(9 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.mint_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `create_master_edition_v3` CPI instruction builder. +pub struct CreateMasterEditionV3CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> CreateMasterEditionV3CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(CreateMasterEditionV3CpiBuilderInstruction { + __program: program, + edition: None, + mint: None, + update_authority: None, + mint_authority: None, + payer: None, + metadata: None, + token_program: None, + system_program: None, + rent: None, + max_supply: None, + }); + Self { instruction } + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn mint_authority( + &mut self, + mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.mint_authority = Some(mint_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn max_supply(&mut self, max_supply: u64) -> &mut Self { + self.instruction.max_supply = Some(max_supply); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> CreateMasterEditionV3Cpi<'a> { + let args = CreateMasterEditionV3InstructionArgs::new(self.instruction.max_supply.clone()); + + CreateMasterEditionV3Cpi { + __program: self.instruction.__program, + + edition: self.instruction.edition.expect("edition is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + mint_authority: self + .instruction + .mint_authority + .expect("mint_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + __args: args, + } + } +} + +struct CreateMasterEditionV3CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + max_supply: Option, +} diff --git a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs new file mode 100644 index 00000000..08148ba6 --- /dev/null +++ b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs @@ -0,0 +1,407 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::CollectionDetails; +use crate::generated::types::DataV2; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct CreateMetadataAccountV3 { + /// Metadata key (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of token asset + pub mint: solana_program::pubkey::Pubkey, + /// Mint authority + pub mint_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// update authority info + pub update_authority: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl CreateMetadataAccountV3 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: CreateMetadataAccountV3InstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateMetadataAccountV3InstructionArgs { + discriminator: u8, + pub data: DataV2, + pub is_mutable: bool, + pub collection_details: Option, +} + +impl CreateMetadataAccountV3InstructionArgs { + pub fn new( + data: DataV2, + is_mutable: bool, + collection_details: Option, + ) -> Self { + Self { + discriminator: 33, + data, + is_mutable, + collection_details, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct CreateMetadataAccountV3Builder { + metadata: Option, + mint: Option, + mint_authority: Option, + payer: Option, + update_authority: Option, + system_program: Option, + rent: Option, + data: Option, + is_mutable: Option, + collection_details: Option, +} + +impl CreateMetadataAccountV3Builder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn mint_authority(&mut self, mint_authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint_authority = Some(mint_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn data(&mut self, data: DataV2) -> &mut Self { + self.data = Some(data); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.is_mutable = Some(is_mutable); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { + self.collection_details = Some(collection_details); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = CreateMetadataAccountV3 { + metadata: self.metadata.expect("metadata is not set"), + mint: self.mint.expect("mint is not set"), + mint_authority: self.mint_authority.expect("mint_authority is not set"), + payer: self.payer.expect("payer is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + let args = CreateMetadataAccountV3InstructionArgs::new( + self.data.clone().expect("data is not set"), + self.is_mutable.clone().expect("is_mutable is not set"), + self.collection_details.clone(), + ); + + accounts.instruction(args) + } +} + +/// `create_metadata_account_v3` CPI instruction. +pub struct CreateMetadataAccountV3Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata key (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of token asset + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint authority + pub mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// update authority info + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: CreateMetadataAccountV3InstructionArgs, +} + +impl<'a> CreateMetadataAccountV3Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.mint_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `create_metadata_account_v3` CPI instruction builder. +pub struct CreateMetadataAccountV3CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(CreateMetadataAccountV3CpiBuilderInstruction { + __program: program, + metadata: None, + mint: None, + mint_authority: None, + payer: None, + update_authority: None, + system_program: None, + rent: None, + data: None, + is_mutable: None, + collection_details: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn mint_authority( + &mut self, + mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.mint_authority = Some(mint_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn data(&mut self, data: DataV2) -> &mut Self { + self.instruction.data = Some(data); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.instruction.is_mutable = Some(is_mutable); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { + self.instruction.collection_details = Some(collection_details); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> CreateMetadataAccountV3Cpi<'a> { + let args = CreateMetadataAccountV3InstructionArgs::new( + self.instruction.data.clone().expect("data is not set"), + self.instruction + .is_mutable + .clone() + .expect("is_mutable is not set"), + self.instruction.collection_details.clone(), + ); + + CreateMetadataAccountV3Cpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + mint_authority: self + .instruction + .mint_authority + .expect("mint_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + __args: args, + } + } +} + +struct CreateMetadataAccountV3CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + data: Option, + is_mutable: Option, + collection_details: Option, +} diff --git a/clients/rust/src/generated/instructions/create_v1.rs b/clients/rust/src/generated/instructions/create_v1.rs new file mode 100644 index 00000000..3f4bec1e --- /dev/null +++ b/clients/rust/src/generated/instructions/create_v1.rs @@ -0,0 +1,680 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Collection; +use crate::generated::types::CollectionDetails; +use crate::generated::types::Creator; +use crate::generated::types::PrintSupply; +use crate::generated::types::TokenStandard; +use crate::generated::types::Uses; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +/// Accounts. +pub struct CreateV1 { + /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] + pub metadata: solana_program::pubkey::Pubkey, + /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] + pub master_edition: Option, + /// Mint of token asset + pub mint: (solana_program::pubkey::Pubkey, bool), + /// Mint authority + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// Update authority for the metadata account + pub update_authority: (solana_program::pubkey::Pubkey, bool), + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token program + pub spl_token_program: solana_program::pubkey::Pubkey, +} + +impl CreateV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: CreateV1InstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint.0, + self.mint.1, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority.0, + self.update_authority.1, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateV1InstructionArgs { + discriminator: u8, + create_v1_discriminator: u8, + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, + pub primary_sale_happened: bool, + pub is_mutable: bool, + pub token_standard: TokenStandard, + pub collection: Option, + pub uses: Option, + pub collection_details: Option, + pub rule_set: Option, + pub decimals: Option, + pub print_supply: Option, +} + +impl CreateV1InstructionArgs { + pub fn new( + name: String, + uri: String, + seller_fee_basis_points: u16, + creators: Option>, + token_standard: TokenStandard, + ) -> Self { + Self { + discriminator: 42, + create_v1_discriminator: 0, + name, + symbol: String::from(""), + uri, + seller_fee_basis_points, + creators, + primary_sale_happened: false, + is_mutable: true, + token_standard, + collection: None, + uses: None, + collection_details: None, + rule_set: None, + decimals: None, + print_supply: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct CreateV1Builder { + metadata: Option, + master_edition: Option, + mint: Option<(solana_program::pubkey::Pubkey, bool)>, + authority: Option, + payer: Option, + update_authority: Option<(solana_program::pubkey::Pubkey, bool)>, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + name: Option, + symbol: Option, + uri: Option, + seller_fee_basis_points: Option, + creators: Option>, + primary_sale_happened: Option, + is_mutable: Option, + token_standard: Option, + collection: Option, + uses: Option, + collection_details: Option, + rule_set: Option, + decimals: Option, + print_supply: Option, +} + +impl CreateV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey, as_signer: bool) -> &mut Self { + self.mint = Some((mint, as_signer)); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + as_signer: bool, + ) -> &mut Self { + self.update_authority = Some((update_authority, as_signer)); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn name(&mut self, name: String) -> &mut Self { + self.name = Some(name); + self + } + pub fn symbol(&mut self, symbol: String) -> &mut Self { + self.symbol = Some(symbol); + self + } + pub fn uri(&mut self, uri: String) -> &mut Self { + self.uri = Some(uri); + self + } + pub fn seller_fee_basis_points(&mut self, seller_fee_basis_points: u16) -> &mut Self { + self.seller_fee_basis_points = Some(seller_fee_basis_points); + self + } + pub fn creators(&mut self, creators: Vec) -> &mut Self { + self.creators = Some(creators); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.is_mutable = Some(is_mutable); + self + } + pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { + self.token_standard = Some(token_standard); + self + } + pub fn collection(&mut self, collection: Collection) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn uses(&mut self, uses: Uses) -> &mut Self { + self.uses = Some(uses); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { + self.collection_details = Some(collection_details); + self + } + pub fn rule_set(&mut self, rule_set: Pubkey) -> &mut Self { + self.rule_set = Some(rule_set); + self + } + pub fn decimals(&mut self, decimals: u8) -> &mut Self { + self.decimals = Some(decimals); + self + } + pub fn print_supply(&mut self, print_supply: PrintSupply) -> &mut Self { + self.print_supply = Some(print_supply); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = CreateV1 { + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + mint: self.mint.expect("mint is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + }; + let mut args = CreateV1InstructionArgs::new( + self.name.clone().expect("name is not set"), + self.uri.clone().expect("uri is not set"), + self.seller_fee_basis_points + .clone() + .expect("seller_fee_basis_points is not set"), + self.creators.clone(), + self.token_standard + .clone() + .expect("token_standard is not set"), + ); + if let Some(symbol) = &self.symbol { + args.symbol = symbol.clone(); + } + if let Some(primary_sale_happened) = &self.primary_sale_happened { + args.primary_sale_happened = primary_sale_happened.clone(); + } + if let Some(is_mutable) = &self.is_mutable { + args.is_mutable = is_mutable.clone(); + } + args.collection = self.collection.clone(); + args.uses = self.uses.clone(); + args.collection_details = self.collection_details.clone(); + args.rule_set = self.rule_set.clone(); + args.decimals = self.decimals.clone(); + args.print_supply = self.print_supply.clone(); + + accounts.instruction(args) + } +} + +/// `create_v1` CPI instruction. +pub struct CreateV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of token asset + pub mint: (&'a solana_program::account_info::AccountInfo<'a>, bool), + /// Mint authority + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority for the metadata account + pub update_authority: (&'a solana_program::account_info::AccountInfo<'a>, bool), + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// The arguments for the instruction. + pub __args: CreateV1InstructionArgs, +} + +impl<'a> CreateV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new( + *master_edition.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.0.key, + self.mint.1, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.0.key, + self.update_authority.1, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(9 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + account_infos.push(self.mint.0.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.update_authority.0.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + account_infos.push(self.spl_token_program.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `create_v1` CPI instruction builder. +pub struct CreateV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> CreateV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(CreateV1CpiBuilderInstruction { + __program: program, + metadata: None, + master_edition: None, + mint: None, + authority: None, + payer: None, + update_authority: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + name: None, + symbol: None, + uri: None, + seller_fee_basis_points: None, + creators: None, + primary_sale_happened: None, + is_mutable: None, + token_standard: None, + collection: None, + uses: None, + collection_details: None, + rule_set: None, + decimals: None, + print_supply: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn mint( + &mut self, + mint: &'a solana_program::account_info::AccountInfo<'a>, + as_signer: bool, + ) -> &mut Self { + self.instruction.mint = Some((mint, as_signer)); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + as_signer: bool, + ) -> &mut Self { + self.instruction.update_authority = Some((update_authority, as_signer)); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn name(&mut self, name: String) -> &mut Self { + self.instruction.name = Some(name); + self + } + pub fn symbol(&mut self, symbol: String) -> &mut Self { + self.instruction.symbol = Some(symbol); + self + } + pub fn uri(&mut self, uri: String) -> &mut Self { + self.instruction.uri = Some(uri); + self + } + pub fn seller_fee_basis_points(&mut self, seller_fee_basis_points: u16) -> &mut Self { + self.instruction.seller_fee_basis_points = Some(seller_fee_basis_points); + self + } + pub fn creators(&mut self, creators: Vec) -> &mut Self { + self.instruction.creators = Some(creators); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.instruction.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.instruction.is_mutable = Some(is_mutable); + self + } + pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { + self.instruction.token_standard = Some(token_standard); + self + } + pub fn collection(&mut self, collection: Collection) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn uses(&mut self, uses: Uses) -> &mut Self { + self.instruction.uses = Some(uses); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { + self.instruction.collection_details = Some(collection_details); + self + } + pub fn rule_set(&mut self, rule_set: Pubkey) -> &mut Self { + self.instruction.rule_set = Some(rule_set); + self + } + pub fn decimals(&mut self, decimals: u8) -> &mut Self { + self.instruction.decimals = Some(decimals); + self + } + pub fn print_supply(&mut self, print_supply: PrintSupply) -> &mut Self { + self.instruction.print_supply = Some(print_supply); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> CreateV1Cpi<'a> { + let mut args = CreateV1InstructionArgs::new( + self.instruction.name.clone().expect("name is not set"), + self.instruction.uri.clone().expect("uri is not set"), + self.instruction + .seller_fee_basis_points + .clone() + .expect("seller_fee_basis_points is not set"), + self.instruction.creators.clone(), + self.instruction + .token_standard + .clone() + .expect("token_standard is not set"), + ); + if let Some(symbol) = &self.instruction.symbol { + args.symbol = symbol.clone(); + } + if let Some(primary_sale_happened) = &self.instruction.primary_sale_happened { + args.primary_sale_happened = primary_sale_happened.clone(); + } + if let Some(is_mutable) = &self.instruction.is_mutable { + args.is_mutable = is_mutable.clone(); + } + args.collection = self.instruction.collection.clone(); + args.uses = self.instruction.uses.clone(); + args.collection_details = self.instruction.collection_details.clone(); + args.rule_set = self.instruction.rule_set.clone(); + args.decimals = self.instruction.decimals.clone(); + args.print_supply = self.instruction.print_supply.clone(); + + CreateV1Cpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + mint: self.instruction.mint.expect("mint is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + __args: args, + } + } +} + +struct CreateV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<(&'a solana_program::account_info::AccountInfo<'a>, bool)>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<(&'a solana_program::account_info::AccountInfo<'a>, bool)>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + name: Option, + symbol: Option, + uri: Option, + seller_fee_basis_points: Option, + creators: Option>, + primary_sale_happened: Option, + is_mutable: Option, + token_standard: Option, + collection: Option, + uses: Option, + collection_details: Option, + rule_set: Option, + decimals: Option, + print_supply: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs new file mode 100644 index 00000000..bb0bb184 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateAuthorityItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateAuthorityItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateAuthorityItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateAuthorityItemV1InstructionArgs { + discriminator: u8, + delegate_authority_item_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateAuthorityItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_authority_item_v1_discriminator: 9, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateAuthorityItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateAuthorityItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateAuthorityItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_authority_item_v1` CPI instruction. +pub struct DelegateAuthorityItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateAuthorityItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateAuthorityItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_authority_item_v1` CPI instruction builder. +pub struct DelegateAuthorityItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateAuthorityItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateAuthorityItemV1Cpi<'a> { + DelegateAuthorityItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateAuthorityItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs new file mode 100644 index 00000000..ff343f23 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateCollectionItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateCollectionItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateCollectionItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateCollectionItemV1InstructionArgs { + discriminator: u8, + delegate_collection_item_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateCollectionItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_collection_item_v1_discriminator: 11, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateCollectionItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateCollectionItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateCollectionItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_collection_item_v1` CPI instruction. +pub struct DelegateCollectionItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateCollectionItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateCollectionItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_collection_item_v1` CPI instruction builder. +pub struct DelegateCollectionItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateCollectionItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateCollectionItemV1Cpi<'a> { + DelegateCollectionItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateCollectionItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_collection_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_v1.rs new file mode 100644 index 00000000..1b00c4db --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_collection_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateCollectionV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateCollectionV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateCollectionV1InstructionArgs { + discriminator: u8, + delegate_collection_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateCollectionV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_collection_v1_discriminator: 0, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateCollectionV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateCollectionV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateCollectionV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_collection_v1` CPI instruction. +pub struct DelegateCollectionV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateCollectionV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_collection_v1` CPI instruction builder. +pub struct DelegateCollectionV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateCollectionV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateCollectionV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateCollectionV1Cpi<'a> { + DelegateCollectionV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateCollectionV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs new file mode 100644 index 00000000..40015d2f --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateDataItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateDataItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateDataItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateDataItemV1InstructionArgs { + discriminator: u8, + delegate_data_item_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateDataItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_data_item_v1_discriminator: 10, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateDataItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateDataItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateDataItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_data_item_v1` CPI instruction. +pub struct DelegateDataItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateDataItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateDataItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_data_item_v1` CPI instruction builder. +pub struct DelegateDataItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateDataItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateDataItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateDataItemV1Cpi<'a> { + DelegateDataItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateDataItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_data_v1.rs b/clients/rust/src/generated/instructions/delegate_data_v1.rs new file mode 100644 index 00000000..00457a77 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_data_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateDataV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateDataV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateDataV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateDataV1InstructionArgs { + discriminator: u8, + delegate_data_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateDataV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_data_v1_discriminator: 3, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateDataV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateDataV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateDataV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_data_v1` CPI instruction. +pub struct DelegateDataV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateDataV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateDataV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_data_v1` CPI instruction builder. +pub struct DelegateDataV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateDataV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateDataV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateDataV1Cpi<'a> { + DelegateDataV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateDataV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs new file mode 100644 index 00000000..1d50f7ee --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs @@ -0,0 +1,688 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +/// Accounts. +pub struct DelegateLockedTransferV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateLockedTransferV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: DelegateLockedTransferV1InstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateLockedTransferV1InstructionArgs { + discriminator: u8, + delegate_locked_transfer_v1_discriminator: u8, + pub amount: u64, + pub locked_address: Pubkey, + pub authorization_data: Option, +} + +impl DelegateLockedTransferV1InstructionArgs { + pub fn new(locked_address: Pubkey) -> Self { + Self { + discriminator: 44, + delegate_locked_transfer_v1_discriminator: 7, + amount: 1, + locked_address, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateLockedTransferV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + locked_address: Option, + authorization_data: Option, +} + +impl DelegateLockedTransferV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn locked_address(&mut self, locked_address: Pubkey) -> &mut Self { + self.locked_address = Some(locked_address); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateLockedTransferV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + let mut args = DelegateLockedTransferV1InstructionArgs::new( + self.locked_address + .clone() + .expect("locked_address is not set"), + ); + if let Some(amount) = &self.amount { + args.amount = amount.clone(); + } + args.authorization_data = self.authorization_data.clone(); + + accounts.instruction(args) + } +} + +/// `delegate_locked_transfer_v1` CPI instruction. +pub struct DelegateLockedTransferV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateLockedTransferV1InstructionArgs, +} + +impl<'a> DelegateLockedTransferV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_locked_transfer_v1` CPI instruction builder. +pub struct DelegateLockedTransferV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateLockedTransferV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + locked_address: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn locked_address(&mut self, locked_address: Pubkey) -> &mut Self { + self.instruction.locked_address = Some(locked_address); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateLockedTransferV1Cpi<'a> { + let mut args = DelegateLockedTransferV1InstructionArgs::new( + self.instruction + .locked_address + .clone() + .expect("locked_address is not set"), + ); + if let Some(amount) = &self.instruction.amount { + args.amount = amount.clone(); + } + args.authorization_data = self.instruction.authorization_data.clone(); + + DelegateLockedTransferV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + __args: args, + } + } +} + +struct DelegateLockedTransferV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + locked_address: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs new file mode 100644 index 00000000..c3cccc6e --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateProgrammableConfigItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateProgrammableConfigItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateProgrammableConfigItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateProgrammableConfigItemV1InstructionArgs { + discriminator: u8, + delegate_programmable_config_item_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateProgrammableConfigItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_programmable_config_item_v1_discriminator: 12, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateProgrammableConfigItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateProgrammableConfigItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateProgrammableConfigItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_programmable_config_item_v1` CPI instruction. +pub struct DelegateProgrammableConfigItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateProgrammableConfigItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_programmable_config_item_v1` CPI instruction builder. +pub struct DelegateProgrammableConfigItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateProgrammableConfigItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateProgrammableConfigItemV1Cpi<'a> { + DelegateProgrammableConfigItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateProgrammableConfigItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs new file mode 100644 index 00000000..d8da0ec4 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs @@ -0,0 +1,657 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateProgrammableConfigV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateProgrammableConfigV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateProgrammableConfigV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateProgrammableConfigV1InstructionArgs { + discriminator: u8, + delegate_programmable_config_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl DelegateProgrammableConfigV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_programmable_config_v1_discriminator: 8, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateProgrammableConfigV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl DelegateProgrammableConfigV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateProgrammableConfigV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_programmable_config_v1` CPI instruction. +pub struct DelegateProgrammableConfigV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateProgrammableConfigV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateProgrammableConfigV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_programmable_config_v1` CPI instruction builder. +pub struct DelegateProgrammableConfigV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateProgrammableConfigV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateProgrammableConfigV1Cpi<'a> { + DelegateProgrammableConfigV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateProgrammableConfigV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_sale_v1.rs b/clients/rust/src/generated/instructions/delegate_sale_v1.rs new file mode 100644 index 00000000..e3e217a1 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_sale_v1.rs @@ -0,0 +1,652 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateSaleV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateSaleV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateSaleV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateSaleV1InstructionArgs { + discriminator: u8, + delegate_sale_v1_discriminator: u8, + pub amount: u64, + pub authorization_data: Option, +} + +impl DelegateSaleV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_sale_v1_discriminator: 1, + amount: 1, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateSaleV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + authorization_data: Option, +} + +impl DelegateSaleV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateSaleV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_sale_v1` CPI instruction. +pub struct DelegateSaleV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateSaleV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateSaleV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_sale_v1` CPI instruction builder. +pub struct DelegateSaleV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateSaleV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateSaleV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateSaleV1Cpi<'a> { + DelegateSaleV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateSaleV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_staking_v1.rs b/clients/rust/src/generated/instructions/delegate_staking_v1.rs new file mode 100644 index 00000000..a776e96f --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_staking_v1.rs @@ -0,0 +1,652 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateStakingV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateStakingV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateStakingV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateStakingV1InstructionArgs { + discriminator: u8, + delegate_staking_v1_discriminator: u8, + pub amount: u64, + pub authorization_data: Option, +} + +impl DelegateStakingV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_staking_v1_discriminator: 5, + amount: 1, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateStakingV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + authorization_data: Option, +} + +impl DelegateStakingV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateStakingV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_staking_v1` CPI instruction. +pub struct DelegateStakingV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateStakingV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateStakingV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_staking_v1` CPI instruction builder. +pub struct DelegateStakingV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateStakingV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateStakingV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateStakingV1Cpi<'a> { + DelegateStakingV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateStakingV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_standard_v1.rs b/clients/rust/src/generated/instructions/delegate_standard_v1.rs new file mode 100644 index 00000000..175a8e29 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_standard_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateStandardV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateStandardV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateStandardV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateStandardV1InstructionArgs { + discriminator: u8, + delegate_standard_v1_discriminator: u8, + pub amount: u64, +} + +impl DelegateStandardV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_standard_v1_discriminator: 6, + amount: 1, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateStandardV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, +} + +impl DelegateStandardV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateStandardV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_standard_v1` CPI instruction. +pub struct DelegateStandardV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateStandardV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateStandardV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_standard_v1` CPI instruction builder. +pub struct DelegateStandardV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateStandardV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateStandardV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateStandardV1Cpi<'a> { + DelegateStandardV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateStandardV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs new file mode 100644 index 00000000..e59fff87 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs @@ -0,0 +1,652 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateTransferV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateTransferV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateTransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateTransferV1InstructionArgs { + discriminator: u8, + delegate_transfer_v1_discriminator: u8, + pub amount: u64, + pub authorization_data: Option, +} + +impl DelegateTransferV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_transfer_v1_discriminator: 2, + amount: 1, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateTransferV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + authorization_data: Option, +} + +impl DelegateTransferV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateTransferV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_transfer_v1` CPI instruction. +pub struct DelegateTransferV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateTransferV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateTransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_transfer_v1` CPI instruction builder. +pub struct DelegateTransferV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateTransferV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateTransferV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateTransferV1Cpi<'a> { + DelegateTransferV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateTransferV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/delegate_utility_v1.rs b/clients/rust/src/generated/instructions/delegate_utility_v1.rs new file mode 100644 index 00000000..efb74a67 --- /dev/null +++ b/clients/rust/src/generated/instructions/delegate_utility_v1.rs @@ -0,0 +1,652 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DelegateUtilityV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl DelegateUtilityV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DelegateUtilityV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DelegateUtilityV1InstructionArgs { + discriminator: u8, + delegate_utility_v1_discriminator: u8, + pub amount: u64, + pub authorization_data: Option, +} + +impl DelegateUtilityV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 44, + delegate_utility_v1_discriminator: 4, + amount: 1, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DelegateUtilityV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + authorization_data: Option, +} + +impl DelegateUtilityV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DelegateUtilityV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `delegate_utility_v1` CPI instruction. +pub struct DelegateUtilityV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DelegateUtilityV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DelegateUtilityV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `delegate_utility_v1` CPI instruction builder. +pub struct DelegateUtilityV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> DelegateUtilityV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(DelegateUtilityV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DelegateUtilityV1Cpi<'a> { + DelegateUtilityV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct DelegateUtilityV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs new file mode 100644 index 00000000..d36c4080 --- /dev/null +++ b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs @@ -0,0 +1,656 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// New Edition V1 (pda of ['metadata', program id, mint id, 'edition']) + pub edition: solana_program::pubkey::Pubkey, + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: solana_program::pubkey::Pubkey, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub mint: solana_program::pubkey::Pubkey, + /// Mint authority of new mint + pub mint_authority: solana_program::pubkey::Pubkey, + /// Printing Mint of master record edition + pub printing_mint: solana_program::pubkey::Pubkey, + /// Token account containing Printing mint token to be transferred + pub master_token_account: solana_program::pubkey::Pubkey, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number]) + pub edition_marker: solana_program::pubkey::Pubkey, + /// Burn authority for this token + pub burn_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// update authority info for new metadata account + pub master_update_authority: solana_program::pubkey::Pubkey, + /// Master record metadata account + pub master_metadata: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: solana_program::pubkey::Pubkey, + /// Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list. + pub reservation_list: Option, +} + +impl DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(16); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.printing_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_marker, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.burn_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.rent, false, + )); + if let Some(reservation_list) = self.reservation_list { + accounts.push(solana_program::instruction::AccountMeta::new( + reservation_list, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs { + discriminator: u8, +} + +impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 3 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenBuilder { + metadata: Option, + edition: Option, + master_edition: Option, + mint: Option, + mint_authority: Option, + printing_mint: Option, + master_token_account: Option, + edition_marker: Option, + burn_authority: Option, + payer: Option, + master_update_authority: Option, + master_metadata: Option, + token_program: Option, + system_program: Option, + rent: Option, + reservation_list: Option, +} + +impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn mint_authority(&mut self, mint_authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint_authority = Some(mint_authority); + self + } + pub fn printing_mint(&mut self, printing_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.printing_mint = Some(printing_mint); + self + } + pub fn master_token_account( + &mut self, + master_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_token_account = Some(master_token_account); + self + } + pub fn edition_marker(&mut self, edition_marker: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition_marker = Some(edition_marker); + self + } + pub fn burn_authority(&mut self, burn_authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.burn_authority = Some(burn_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn master_update_authority( + &mut self, + master_update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_update_authority = Some(master_update_authority); + self + } + pub fn master_metadata( + &mut self, + master_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_metadata = Some(master_metadata); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn reservation_list( + &mut self, + reservation_list: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.reservation_list = Some(reservation_list); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition.expect("edition is not set"), + master_edition: self.master_edition.expect("master_edition is not set"), + mint: self.mint.expect("mint is not set"), + mint_authority: self.mint_authority.expect("mint_authority is not set"), + printing_mint: self.printing_mint.expect("printing_mint is not set"), + master_token_account: self + .master_token_account + .expect("master_token_account is not set"), + edition_marker: self.edition_marker.expect("edition_marker is not set"), + burn_authority: self.burn_authority.expect("burn_authority is not set"), + payer: self.payer.expect("payer is not set"), + master_update_authority: self + .master_update_authority + .expect("master_update_authority is not set"), + master_metadata: self.master_metadata.expect("master_metadata is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent.unwrap_or(solana_program::pubkey!( + "SysvarRent111111111111111111111111111111111" + )), + reservation_list: self.reservation_list, + }; + + accounts.instruction() + } +} + +/// `deprecated_mint_new_edition_from_master_edition_via_printing_token` CPI instruction. +pub struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// New Edition V1 (pda of ['metadata', program id, mint id, 'edition']) + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint authority of new mint + pub mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Printing Mint of master record edition + pub printing_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account containing Printing mint token to be transferred + pub master_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number]) + pub edition_marker: &'a solana_program::account_info::AccountInfo<'a>, + /// Burn authority for this token + pub burn_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// update authority info for new metadata account + pub master_update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Master record metadata account + pub master_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: &'a solana_program::account_info::AccountInfo<'a>, + /// Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list. + pub reservation_list: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(16); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.printing_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_marker.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.burn_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.rent.key, + false, + )); + if let Some(reservation_list) = self.reservation_list { + accounts.push(solana_program::instruction::AccountMeta::new( + *reservation_list.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(16 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.master_edition.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.mint_authority.clone()); + account_infos.push(self.printing_mint.clone()); + account_infos.push(self.master_token_account.clone()); + account_infos.push(self.edition_marker.clone()); + account_infos.push(self.burn_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.master_update_authority.clone()); + account_infos.push(self.master_metadata.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.rent.clone()); + if let Some(reservation_list) = self.reservation_list { + account_infos.push(reservation_list.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `deprecated_mint_new_edition_from_master_edition_via_printing_token` CPI instruction builder. +pub struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> { + instruction: + Box>, +} + +impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new( + DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilderInstruction { + __program: program, + metadata: None, + edition: None, + master_edition: None, + mint: None, + mint_authority: None, + printing_mint: None, + master_token_account: None, + edition_marker: None, + burn_authority: None, + payer: None, + master_update_authority: None, + master_metadata: None, + token_program: None, + system_program: None, + rent: None, + reservation_list: None, + }, + ); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn mint_authority( + &mut self, + mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.mint_authority = Some(mint_authority); + self + } + pub fn printing_mint( + &mut self, + printing_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.printing_mint = Some(printing_mint); + self + } + pub fn master_token_account( + &mut self, + master_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_token_account = Some(master_token_account); + self + } + pub fn edition_marker( + &mut self, + edition_marker: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_marker = Some(edition_marker); + self + } + pub fn burn_authority( + &mut self, + burn_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.burn_authority = Some(burn_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn master_update_authority( + &mut self, + master_update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_update_authority = Some(master_update_authority); + self + } + pub fn master_metadata( + &mut self, + master_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_metadata = Some(master_metadata); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn reservation_list( + &mut self, + reservation_list: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.reservation_list = Some(reservation_list); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { + DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + master_edition: self + .instruction + .master_edition + .expect("master_edition is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + mint_authority: self + .instruction + .mint_authority + .expect("mint_authority is not set"), + + printing_mint: self + .instruction + .printing_mint + .expect("printing_mint is not set"), + + master_token_account: self + .instruction + .master_token_account + .expect("master_token_account is not set"), + + edition_marker: self + .instruction + .edition_marker + .expect("edition_marker is not set"), + + burn_authority: self + .instruction + .burn_authority + .expect("burn_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + master_update_authority: self + .instruction + .master_update_authority + .expect("master_update_authority is not set"), + + master_metadata: self + .instruction + .master_metadata + .expect("master_metadata is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent.expect("rent is not set"), + + reservation_list: self.instruction.reservation_list, + } + } +} + +struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + printing_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_marker: Option<&'a solana_program::account_info::AccountInfo<'a>>, + burn_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + reservation_list: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/freeze_delegated_account.rs b/clients/rust/src/generated/instructions/freeze_delegated_account.rs new file mode 100644 index 00000000..2bb5e061 --- /dev/null +++ b/clients/rust/src/generated/instructions/freeze_delegated_account.rs @@ -0,0 +1,271 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct FreezeDelegatedAccount { + /// Delegate + pub delegate: solana_program::pubkey::Pubkey, + /// Token account to freeze + pub token_account: solana_program::pubkey::Pubkey, + /// Edition + pub edition: solana_program::pubkey::Pubkey, + /// Token mint + pub mint: solana_program::pubkey::Pubkey, + /// Token Program + pub token_program: solana_program::pubkey::Pubkey, +} + +impl FreezeDelegatedAccount { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = FreezeDelegatedAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + self.delegate, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct FreezeDelegatedAccountInstructionArgs { + discriminator: u8, +} + +impl FreezeDelegatedAccountInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 26 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct FreezeDelegatedAccountBuilder { + delegate: Option, + token_account: Option, + edition: Option, + mint: Option, + token_program: Option, +} + +impl FreezeDelegatedAccountBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = FreezeDelegatedAccount { + delegate: self.delegate.expect("delegate is not set"), + token_account: self.token_account.expect("token_account is not set"), + edition: self.edition.expect("edition is not set"), + mint: self.mint.expect("mint is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + }; + + accounts.instruction() + } +} + +/// `freeze_delegated_account` CPI instruction. +pub struct FreezeDelegatedAccountCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account to freeze + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Token mint + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> FreezeDelegatedAccountCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = FreezeDelegatedAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.delegate.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(5 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.delegate.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.token_program.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `freeze_delegated_account` CPI instruction builder. +pub struct FreezeDelegatedAccountCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> FreezeDelegatedAccountCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(FreezeDelegatedAccountCpiBuilderInstruction { + __program: program, + delegate: None, + token_account: None, + edition: None, + mint: None, + token_program: None, + }); + Self { instruction } + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> FreezeDelegatedAccountCpi<'a> { + FreezeDelegatedAccountCpi { + __program: self.instruction.__program, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + } + } +} + +struct FreezeDelegatedAccountCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/lock_v1.rs b/clients/rust/src/generated/instructions/lock_v1.rs new file mode 100644 index 00000000..fb20a8b8 --- /dev/null +++ b/clients/rust/src/generated/instructions/lock_v1.rs @@ -0,0 +1,605 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct LockV1 { + /// Delegate or freeze authority + pub authority: solana_program::pubkey::Pubkey, + /// Token owner account + pub token_owner: Option, + /// Token account + pub token: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Token record account + pub token_record: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// System program + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl LockV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = LockV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(13); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(token_owner) = self.token_owner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token_owner, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct LockV1InstructionArgs { + discriminator: u8, + lock_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl LockV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 46, + lock_v1_discriminator: 0, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct LockV1Builder { + authority: Option, + token_owner: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + token_record: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl LockV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_owner = Some(token_owner); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = LockV1 { + authority: self.authority.expect("authority is not set"), + token_owner: self.token_owner, + token: self.token.expect("token is not set"), + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + token_record: self.token_record, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `lock_v1` CPI instruction. +pub struct LockV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate or freeze authority + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Token owner account + pub token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> LockV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = LockV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(13); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(token_owner) = self.token_owner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token_owner.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(13 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(token_owner) = self.token_owner { + account_infos.push(token_owner.clone()); + } + account_infos.push(self.token.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `lock_v1` CPI instruction builder. +pub struct LockV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> LockV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(LockV1CpiBuilderInstruction { + __program: program, + authority: None, + token_owner: None, + token: None, + mint: None, + metadata: None, + edition: None, + token_record: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn token_owner( + &mut self, + token_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_owner = Some(token_owner); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> LockV1Cpi<'a> { + LockV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + token_owner: self.instruction.token_owner, + + token: self.instruction.token.expect("token is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + token_record: self.instruction.token_record, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct LockV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/migrate.rs b/clients/rust/src/generated/instructions/migrate.rs new file mode 100644 index 00000000..a8878b70 --- /dev/null +++ b/clients/rust/src/generated/instructions/migrate.rs @@ -0,0 +1,629 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct Migrate { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: solana_program::pubkey::Pubkey, + /// Token account + pub token: solana_program::pubkey::Pubkey, + /// Token account owner + pub token_owner: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// Update authority + pub authority: solana_program::pubkey::Pubkey, + /// Collection metadata account + pub collection_metadata: solana_program::pubkey::Pubkey, + /// Delegate record account + pub delegate_record: solana_program::pubkey::Pubkey, + /// Token record account + pub token_record: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instruction sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl Migrate { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = MigrateInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(15); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_owner, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate_record, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token_record, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct MigrateInstructionArgs { + discriminator: u8, +} + +impl MigrateInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 48 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct MigrateBuilder { + metadata: Option, + edition: Option, + token: Option, + token_owner: Option, + mint: Option, + payer: Option, + authority: Option, + collection_metadata: Option, + delegate_record: Option, + token_record: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl MigrateBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_owner = Some(token_owner); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = Migrate { + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition.expect("edition is not set"), + token: self.token.expect("token is not set"), + token_owner: self.token_owner.expect("token_owner is not set"), + mint: self.mint.expect("mint is not set"), + payer: self.payer.expect("payer is not set"), + authority: self.authority.expect("authority is not set"), + collection_metadata: self + .collection_metadata + .expect("collection_metadata is not set"), + delegate_record: self.delegate_record.expect("delegate_record is not set"), + token_record: self.token_record.expect("token_record is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `migrate` CPI instruction. +pub struct MigrateCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account owner + pub token_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection metadata account + pub collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + /// Token record account + pub token_record: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instruction sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> MigrateCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = MigrateInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(15); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_owner.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate_record.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token_record.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(15 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.token_owner.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.collection_metadata.clone()); + account_infos.push(self.delegate_record.clone()); + account_infos.push(self.token_record.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + account_infos.push(self.spl_token_program.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `migrate` CPI instruction builder. +pub struct MigrateCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> MigrateCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(MigrateCpiBuilderInstruction { + __program: program, + metadata: None, + edition: None, + token: None, + token_owner: None, + mint: None, + payer: None, + authority: None, + collection_metadata: None, + delegate_record: None, + token_record: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn token_owner( + &mut self, + token_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_owner = Some(token_owner); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> MigrateCpi<'a> { + MigrateCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + token: self.instruction.token.expect("token is not set"), + + token_owner: self + .instruction + .token_owner + .expect("token_owner is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + collection_metadata: self + .instruction + .collection_metadata + .expect("collection_metadata is not set"), + + delegate_record: self + .instruction + .delegate_record + .expect("delegate_record is not set"), + + token_record: self + .instruction + .token_record + .expect("token_record is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct MigrateCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs new file mode 100644 index 00000000..ea43ab08 --- /dev/null +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs @@ -0,0 +1,642 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::MintNewEditionFromMasterEditionViaTokenArgs; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct MintNewEditionFromMasterEditionViaToken { + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub new_metadata: solana_program::pubkey::Pubkey, + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + pub new_edition: solana_program::pubkey::Pubkey, + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: solana_program::pubkey::Pubkey, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub new_mint: solana_program::pubkey::Pubkey, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + pub edition_mark_pda: solana_program::pubkey::Pubkey, + /// Mint authority of new mint + pub new_mint_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// owner of token account containing master token (#8) + pub token_account_owner: solana_program::pubkey::Pubkey, + /// token account containing token from master metadata mint + pub token_account: solana_program::pubkey::Pubkey, + /// Update authority info for new metadata + pub new_metadata_update_authority: solana_program::pubkey::Pubkey, + /// Master record metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl MintNewEditionFromMasterEditionViaToken { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: MintNewEditionFromMasterEditionViaTokenInstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(14); + accounts.push(solana_program::instruction::AccountMeta::new( + self.new_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.new_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.new_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_mark_pda, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.new_mint_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_account_owner, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.new_metadata_update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct MintNewEditionFromMasterEditionViaTokenInstructionArgs { + discriminator: u8, + pub mint_new_edition_from_master_edition_via_token_args: + MintNewEditionFromMasterEditionViaTokenArgs, +} + +impl MintNewEditionFromMasterEditionViaTokenInstructionArgs { + pub fn new( + mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, + ) -> Self { + Self { + discriminator: 11, + mint_new_edition_from_master_edition_via_token_args, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct MintNewEditionFromMasterEditionViaTokenBuilder { + new_metadata: Option, + new_edition: Option, + master_edition: Option, + new_mint: Option, + edition_mark_pda: Option, + new_mint_authority: Option, + payer: Option, + token_account_owner: Option, + token_account: Option, + new_metadata_update_authority: Option, + metadata: Option, + token_program: Option, + system_program: Option, + rent: Option, + mint_new_edition_from_master_edition_via_token_args: + Option, +} + +impl MintNewEditionFromMasterEditionViaTokenBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn new_metadata(&mut self, new_metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.new_metadata = Some(new_metadata); + self + } + pub fn new_edition(&mut self, new_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.new_edition = Some(new_edition); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn new_mint(&mut self, new_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.new_mint = Some(new_mint); + self + } + pub fn edition_mark_pda( + &mut self, + edition_mark_pda: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_mark_pda = Some(edition_mark_pda); + self + } + pub fn new_mint_authority( + &mut self, + new_mint_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.new_mint_authority = Some(new_mint_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn token_account_owner( + &mut self, + token_account_owner: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.token_account_owner = Some(token_account_owner); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn new_metadata_update_authority( + &mut self, + new_metadata_update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.new_metadata_update_authority = Some(new_metadata_update_authority); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn mint_new_edition_from_master_edition_via_token_args( + &mut self, + mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, + ) -> &mut Self { + self.mint_new_edition_from_master_edition_via_token_args = + Some(mint_new_edition_from_master_edition_via_token_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = MintNewEditionFromMasterEditionViaToken { + new_metadata: self.new_metadata.expect("new_metadata is not set"), + new_edition: self.new_edition.expect("new_edition is not set"), + master_edition: self.master_edition.expect("master_edition is not set"), + new_mint: self.new_mint.expect("new_mint is not set"), + edition_mark_pda: self.edition_mark_pda.expect("edition_mark_pda is not set"), + new_mint_authority: self + .new_mint_authority + .expect("new_mint_authority is not set"), + payer: self.payer.expect("payer is not set"), + token_account_owner: self + .token_account_owner + .expect("token_account_owner is not set"), + token_account: self.token_account.expect("token_account is not set"), + new_metadata_update_authority: self + .new_metadata_update_authority + .expect("new_metadata_update_authority is not set"), + metadata: self.metadata.expect("metadata is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + let args = MintNewEditionFromMasterEditionViaTokenInstructionArgs::new( + self.mint_new_edition_from_master_edition_via_token_args + .clone() + .expect("mint_new_edition_from_master_edition_via_token_args is not set"), + ); + + accounts.instruction(args) + } +} + +/// `mint_new_edition_from_master_edition_via_token` CPI instruction. +pub struct MintNewEditionFromMasterEditionViaTokenCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub new_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + pub new_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub new_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + pub edition_mark_pda: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint authority of new mint + pub new_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// owner of token account containing master token (#8) + pub token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// token account containing token from master metadata mint + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority info for new metadata + pub new_metadata_update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Master record metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: MintNewEditionFromMasterEditionViaTokenInstructionArgs, +} + +impl<'a> MintNewEditionFromMasterEditionViaTokenCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(14); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.new_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.new_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.new_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_mark_pda.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.new_mint_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_account_owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.new_metadata_update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.new_metadata.clone()); + account_infos.push(self.new_edition.clone()); + account_infos.push(self.master_edition.clone()); + account_infos.push(self.new_mint.clone()); + account_infos.push(self.edition_mark_pda.clone()); + account_infos.push(self.new_mint_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.token_account_owner.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.new_metadata_update_authority.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `mint_new_edition_from_master_edition_via_token` CPI instruction builder. +pub struct MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new( + MintNewEditionFromMasterEditionViaTokenCpiBuilderInstruction { + __program: program, + new_metadata: None, + new_edition: None, + master_edition: None, + new_mint: None, + edition_mark_pda: None, + new_mint_authority: None, + payer: None, + token_account_owner: None, + token_account: None, + new_metadata_update_authority: None, + metadata: None, + token_program: None, + system_program: None, + rent: None, + mint_new_edition_from_master_edition_via_token_args: None, + }, + ); + Self { instruction } + } + pub fn new_metadata( + &mut self, + new_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_metadata = Some(new_metadata); + self + } + pub fn new_edition( + &mut self, + new_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_edition = Some(new_edition); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn new_mint( + &mut self, + new_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_mint = Some(new_mint); + self + } + pub fn edition_mark_pda( + &mut self, + edition_mark_pda: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_mark_pda = Some(edition_mark_pda); + self + } + pub fn new_mint_authority( + &mut self, + new_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_mint_authority = Some(new_mint_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn token_account_owner( + &mut self, + token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account_owner = Some(token_account_owner); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn new_metadata_update_authority( + &mut self, + new_metadata_update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_metadata_update_authority = Some(new_metadata_update_authority); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn mint_new_edition_from_master_edition_via_token_args( + &mut self, + mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, + ) -> &mut Self { + self.instruction + .mint_new_edition_from_master_edition_via_token_args = + Some(mint_new_edition_from_master_edition_via_token_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> MintNewEditionFromMasterEditionViaTokenCpi<'a> { + let args = MintNewEditionFromMasterEditionViaTokenInstructionArgs::new( + self.instruction + .mint_new_edition_from_master_edition_via_token_args + .clone() + .expect("mint_new_edition_from_master_edition_via_token_args is not set"), + ); + + MintNewEditionFromMasterEditionViaTokenCpi { + __program: self.instruction.__program, + + new_metadata: self + .instruction + .new_metadata + .expect("new_metadata is not set"), + + new_edition: self + .instruction + .new_edition + .expect("new_edition is not set"), + + master_edition: self + .instruction + .master_edition + .expect("master_edition is not set"), + + new_mint: self.instruction.new_mint.expect("new_mint is not set"), + + edition_mark_pda: self + .instruction + .edition_mark_pda + .expect("edition_mark_pda is not set"), + + new_mint_authority: self + .instruction + .new_mint_authority + .expect("new_mint_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + token_account_owner: self + .instruction + .token_account_owner + .expect("token_account_owner is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + new_metadata_update_authority: self + .instruction + .new_metadata_update_authority + .expect("new_metadata_update_authority is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + __args: args, + } + } +} + +struct MintNewEditionFromMasterEditionViaTokenCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + new_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_mark_pda: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_metadata_update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint_new_edition_from_master_edition_via_token_args: + Option, +} diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs new file mode 100644 index 00000000..79c5ad9f --- /dev/null +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs @@ -0,0 +1,747 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::MintNewEditionFromMasterEditionViaTokenArgs; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct MintNewEditionFromMasterEditionViaVaultProxy { + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub new_metadata: solana_program::pubkey::Pubkey, + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + pub new_edition: solana_program::pubkey::Pubkey, + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'] + pub master_edition: solana_program::pubkey::Pubkey, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub new_mint: solana_program::pubkey::Pubkey, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + pub edition_mark_pda: solana_program::pubkey::Pubkey, + /// Mint authority of new mint + pub new_mint_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// Vault authority + pub vault_authority: solana_program::pubkey::Pubkey, + /// Safety deposit token store account + pub safety_deposit_store: solana_program::pubkey::Pubkey, + /// Safety deposit box + pub safety_deposit_box: solana_program::pubkey::Pubkey, + /// Vault + pub vault: solana_program::pubkey::Pubkey, + /// Update authority info for new metadata + pub new_metadata_update_authority: solana_program::pubkey::Pubkey, + /// Master record metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// Token vault program + pub token_vault_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl MintNewEditionFromMasterEditionViaVaultProxy { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(17); + accounts.push(solana_program::instruction::AccountMeta::new( + self.new_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.new_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.new_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_mark_pda, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.new_mint_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.vault_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.safety_deposit_store, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.safety_deposit_box, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.vault, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.new_metadata_update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_vault_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { + discriminator: u8, + pub mint_new_edition_from_master_edition_via_token_args: + MintNewEditionFromMasterEditionViaTokenArgs, +} + +impl MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { + pub fn new( + mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, + ) -> Self { + Self { + discriminator: 13, + mint_new_edition_from_master_edition_via_token_args, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct MintNewEditionFromMasterEditionViaVaultProxyBuilder { + new_metadata: Option, + new_edition: Option, + master_edition: Option, + new_mint: Option, + edition_mark_pda: Option, + new_mint_authority: Option, + payer: Option, + vault_authority: Option, + safety_deposit_store: Option, + safety_deposit_box: Option, + vault: Option, + new_metadata_update_authority: Option, + metadata: Option, + token_program: Option, + token_vault_program: Option, + system_program: Option, + rent: Option, + mint_new_edition_from_master_edition_via_token_args: + Option, +} + +impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn new_metadata(&mut self, new_metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.new_metadata = Some(new_metadata); + self + } + pub fn new_edition(&mut self, new_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.new_edition = Some(new_edition); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn new_mint(&mut self, new_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.new_mint = Some(new_mint); + self + } + pub fn edition_mark_pda( + &mut self, + edition_mark_pda: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_mark_pda = Some(edition_mark_pda); + self + } + pub fn new_mint_authority( + &mut self, + new_mint_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.new_mint_authority = Some(new_mint_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn vault_authority( + &mut self, + vault_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.vault_authority = Some(vault_authority); + self + } + pub fn safety_deposit_store( + &mut self, + safety_deposit_store: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.safety_deposit_store = Some(safety_deposit_store); + self + } + pub fn safety_deposit_box( + &mut self, + safety_deposit_box: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.safety_deposit_box = Some(safety_deposit_box); + self + } + pub fn vault(&mut self, vault: solana_program::pubkey::Pubkey) -> &mut Self { + self.vault = Some(vault); + self + } + pub fn new_metadata_update_authority( + &mut self, + new_metadata_update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.new_metadata_update_authority = Some(new_metadata_update_authority); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn token_vault_program( + &mut self, + token_vault_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.token_vault_program = Some(token_vault_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn mint_new_edition_from_master_edition_via_token_args( + &mut self, + mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, + ) -> &mut Self { + self.mint_new_edition_from_master_edition_via_token_args = + Some(mint_new_edition_from_master_edition_via_token_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = MintNewEditionFromMasterEditionViaVaultProxy { + new_metadata: self.new_metadata.expect("new_metadata is not set"), + new_edition: self.new_edition.expect("new_edition is not set"), + master_edition: self.master_edition.expect("master_edition is not set"), + new_mint: self.new_mint.expect("new_mint is not set"), + edition_mark_pda: self.edition_mark_pda.expect("edition_mark_pda is not set"), + new_mint_authority: self + .new_mint_authority + .expect("new_mint_authority is not set"), + payer: self.payer.expect("payer is not set"), + vault_authority: self.vault_authority.expect("vault_authority is not set"), + safety_deposit_store: self + .safety_deposit_store + .expect("safety_deposit_store is not set"), + safety_deposit_box: self + .safety_deposit_box + .expect("safety_deposit_box is not set"), + vault: self.vault.expect("vault is not set"), + new_metadata_update_authority: self + .new_metadata_update_authority + .expect("new_metadata_update_authority is not set"), + metadata: self.metadata.expect("metadata is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + token_vault_program: self + .token_vault_program + .expect("token_vault_program is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + let args = MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs::new( + self.mint_new_edition_from_master_edition_via_token_args + .clone() + .expect("mint_new_edition_from_master_edition_via_token_args is not set"), + ); + + accounts.instruction(args) + } +} + +/// `mint_new_edition_from_master_edition_via_vault_proxy` CPI instruction. +pub struct MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub new_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + pub new_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'] + pub master_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub new_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + pub edition_mark_pda: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint authority of new mint + pub new_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Vault authority + pub vault_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Safety deposit token store account + pub safety_deposit_store: &'a solana_program::account_info::AccountInfo<'a>, + /// Safety deposit box + pub safety_deposit_box: &'a solana_program::account_info::AccountInfo<'a>, + /// Vault + pub vault: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority info for new metadata + pub new_metadata_update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Master record metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token vault program + pub token_vault_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs, +} + +impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(17); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.new_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.new_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.new_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_mark_pda.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.new_mint_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.vault_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.safety_deposit_store.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.safety_deposit_box.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.vault.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.new_metadata_update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_vault_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(17 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.new_metadata.clone()); + account_infos.push(self.new_edition.clone()); + account_infos.push(self.master_edition.clone()); + account_infos.push(self.new_mint.clone()); + account_infos.push(self.edition_mark_pda.clone()); + account_infos.push(self.new_mint_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.vault_authority.clone()); + account_infos.push(self.safety_deposit_store.clone()); + account_infos.push(self.safety_deposit_box.clone()); + account_infos.push(self.vault.clone()); + account_infos.push(self.new_metadata_update_authority.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.token_vault_program.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `mint_new_edition_from_master_edition_via_vault_proxy` CPI instruction builder. +pub struct MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new( + MintNewEditionFromMasterEditionViaVaultProxyCpiBuilderInstruction { + __program: program, + new_metadata: None, + new_edition: None, + master_edition: None, + new_mint: None, + edition_mark_pda: None, + new_mint_authority: None, + payer: None, + vault_authority: None, + safety_deposit_store: None, + safety_deposit_box: None, + vault: None, + new_metadata_update_authority: None, + metadata: None, + token_program: None, + token_vault_program: None, + system_program: None, + rent: None, + mint_new_edition_from_master_edition_via_token_args: None, + }, + ); + Self { instruction } + } + pub fn new_metadata( + &mut self, + new_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_metadata = Some(new_metadata); + self + } + pub fn new_edition( + &mut self, + new_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_edition = Some(new_edition); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn new_mint( + &mut self, + new_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_mint = Some(new_mint); + self + } + pub fn edition_mark_pda( + &mut self, + edition_mark_pda: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_mark_pda = Some(edition_mark_pda); + self + } + pub fn new_mint_authority( + &mut self, + new_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_mint_authority = Some(new_mint_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn vault_authority( + &mut self, + vault_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.vault_authority = Some(vault_authority); + self + } + pub fn safety_deposit_store( + &mut self, + safety_deposit_store: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.safety_deposit_store = Some(safety_deposit_store); + self + } + pub fn safety_deposit_box( + &mut self, + safety_deposit_box: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.safety_deposit_box = Some(safety_deposit_box); + self + } + pub fn vault(&mut self, vault: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.vault = Some(vault); + self + } + pub fn new_metadata_update_authority( + &mut self, + new_metadata_update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.new_metadata_update_authority = Some(new_metadata_update_authority); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn token_vault_program( + &mut self, + token_vault_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_vault_program = Some(token_vault_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn mint_new_edition_from_master_edition_via_token_args( + &mut self, + mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, + ) -> &mut Self { + self.instruction + .mint_new_edition_from_master_edition_via_token_args = + Some(mint_new_edition_from_master_edition_via_token_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { + let args = MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs::new( + self.instruction + .mint_new_edition_from_master_edition_via_token_args + .clone() + .expect("mint_new_edition_from_master_edition_via_token_args is not set"), + ); + + MintNewEditionFromMasterEditionViaVaultProxyCpi { + __program: self.instruction.__program, + + new_metadata: self + .instruction + .new_metadata + .expect("new_metadata is not set"), + + new_edition: self + .instruction + .new_edition + .expect("new_edition is not set"), + + master_edition: self + .instruction + .master_edition + .expect("master_edition is not set"), + + new_mint: self.instruction.new_mint.expect("new_mint is not set"), + + edition_mark_pda: self + .instruction + .edition_mark_pda + .expect("edition_mark_pda is not set"), + + new_mint_authority: self + .instruction + .new_mint_authority + .expect("new_mint_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + vault_authority: self + .instruction + .vault_authority + .expect("vault_authority is not set"), + + safety_deposit_store: self + .instruction + .safety_deposit_store + .expect("safety_deposit_store is not set"), + + safety_deposit_box: self + .instruction + .safety_deposit_box + .expect("safety_deposit_box is not set"), + + vault: self.instruction.vault.expect("vault is not set"), + + new_metadata_update_authority: self + .instruction + .new_metadata_update_authority + .expect("new_metadata_update_authority is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + token_vault_program: self + .instruction + .token_vault_program + .expect("token_vault_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + __args: args, + } + } +} + +struct MintNewEditionFromMasterEditionViaVaultProxyCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + new_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_mark_pda: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + vault_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + safety_deposit_store: Option<&'a solana_program::account_info::AccountInfo<'a>>, + safety_deposit_box: Option<&'a solana_program::account_info::AccountInfo<'a>>, + vault: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_metadata_update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_vault_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint_new_edition_from_master_edition_via_token_args: + Option, +} diff --git a/clients/rust/src/generated/instructions/mint_v1.rs b/clients/rust/src/generated/instructions/mint_v1.rs new file mode 100644 index 00000000..6cc61ce3 --- /dev/null +++ b/clients/rust/src/generated/instructions/mint_v1.rs @@ -0,0 +1,700 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct MintV1 { + /// Token or Associated Token account + pub token: solana_program::pubkey::Pubkey, + /// Owner of the token account + pub token_owner: Option, + /// Metadata account (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of token asset + pub mint: solana_program::pubkey::Pubkey, + /// (Mint or Update) authority + pub authority: solana_program::pubkey::Pubkey, + /// Metadata delegate record + pub delegate_record: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token program + pub spl_token_program: solana_program::pubkey::Pubkey, + /// SPL Associated Token Account program + pub spl_ata_program: solana_program::pubkey::Pubkey, + /// Token Authorization Rules program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl MintV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = MintV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(15); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + if let Some(token_owner) = self.token_owner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token_owner, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_ata_program, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct MintV1InstructionArgs { + discriminator: u8, + mint_v1_discriminator: u8, + pub amount: u64, + pub authorization_data: Option, +} + +impl MintV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 43, + mint_v1_discriminator: 0, + amount: 1, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct MintV1Builder { + token: Option, + token_owner: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + authority: Option, + delegate_record: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + spl_ata_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + authorization_data: Option, +} + +impl MintV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_owner = Some(token_owner); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn spl_ata_program( + &mut self, + spl_ata_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_ata_program = Some(spl_ata_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = MintV1 { + token: self.token.expect("token is not set"), + token_owner: self.token_owner, + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + spl_ata_program: self.spl_ata_program.unwrap_or(solana_program::pubkey!( + "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `mint_v1` CPI instruction. +pub struct MintV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token or Associated Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Owner of the token account + pub token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata account (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of token asset + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// (Mint or Update) authority + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata delegate record + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Associated Token Account program + pub spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> MintV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = MintV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(15); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + if let Some(token_owner) = self.token_owner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token_owner.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_ata_program.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(15 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.token.clone()); + if let Some(token_owner) = self.token_owner { + account_infos.push(token_owner.clone()); + } + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + account_infos.push(self.spl_token_program.clone()); + account_infos.push(self.spl_ata_program.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `mint_v1` CPI instruction builder. +pub struct MintV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> MintV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(MintV1CpiBuilderInstruction { + __program: program, + token: None, + token_owner: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + authority: None, + delegate_record: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + spl_ata_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn token_owner( + &mut self, + token_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_owner = Some(token_owner); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn spl_ata_program( + &mut self, + spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_ata_program = Some(spl_ata_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> MintV1Cpi<'a> { + MintV1Cpi { + __program: self.instruction.__program, + + token: self.instruction.token.expect("token is not set"), + + token_owner: self.instruction.token_owner, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + + spl_ata_program: self + .instruction + .spl_ata_program + .expect("spl_ata_program is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct MintV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_ata_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/mod.rs b/clients/rust/src/generated/instructions/mod.rs new file mode 100644 index 00000000..fd2136ee --- /dev/null +++ b/clients/rust/src/generated/instructions/mod.rs @@ -0,0 +1,172 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +pub mod approve_collection_authority; +pub mod approve_use_authority; +pub mod bubblegum_set_collection_size; +pub mod burn_edition_nft; +pub mod burn_nft; +pub mod burn_v1; +pub mod close_escrow_account; +pub mod collect; +pub mod convert_master_edition_v1_to_v2; +pub mod create_escrow_account; +pub mod create_master_edition_v3; +pub mod create_metadata_account_v3; +pub mod create_v1; +pub mod delegate_authority_item_v1; +pub mod delegate_collection_item_v1; +pub mod delegate_collection_v1; +pub mod delegate_data_item_v1; +pub mod delegate_data_v1; +pub mod delegate_locked_transfer_v1; +pub mod delegate_programmable_config_item_v1; +pub mod delegate_programmable_config_v1; +pub mod delegate_sale_v1; +pub mod delegate_staking_v1; +pub mod delegate_standard_v1; +pub mod delegate_transfer_v1; +pub mod delegate_utility_v1; +pub mod deprecated_mint_new_edition_from_master_edition_via_printing_token; +pub mod freeze_delegated_account; +pub mod lock_v1; +pub mod migrate; +pub mod mint_new_edition_from_master_edition_via_token; +pub mod mint_new_edition_from_master_edition_via_vault_proxy; +pub mod mint_v1; +pub mod print_v1; +pub mod puff_metadata; +pub mod remove_creator_verification; +pub mod revoke_authority_item_v1; +pub mod revoke_collection_authority; +pub mod revoke_collection_item_v1; +pub mod revoke_collection_v1; +pub mod revoke_data_item_v1; +pub mod revoke_data_v1; +pub mod revoke_locked_transfer_v1; +pub mod revoke_migration_v1; +pub mod revoke_programmable_config_item_v1; +pub mod revoke_programmable_config_v1; +pub mod revoke_sale_v1; +pub mod revoke_staking_v1; +pub mod revoke_standard_v1; +pub mod revoke_transfer_v1; +pub mod revoke_use_authority; +pub mod revoke_utility_v1; +pub mod set_and_verify_collection; +pub mod set_and_verify_sized_collection_item; +pub mod set_collection_size; +pub mod set_token_standard; +pub mod sign_metadata; +pub mod thaw_delegated_account; +pub mod transfer_out_of_escrow; +pub mod transfer_v1; +pub mod unlock_v1; +pub mod unverify_collection; +pub mod unverify_collection_v1; +pub mod unverify_creator_v1; +pub mod unverify_sized_collection_item; +pub mod update_as_authority_item_delegate_v2; +pub mod update_as_collection_delegate_v2; +pub mod update_as_collection_item_delegate_v2; +pub mod update_as_data_delegate_v2; +pub mod update_as_data_item_delegate_v2; +pub mod update_as_programmable_config_delegate_v2; +pub mod update_as_programmable_config_item_delegate_v2; +pub mod update_as_update_authority_v2; +pub mod update_metadata_account_v2; +pub mod update_primary_sale_happened_via_token; +pub mod update_v1; +pub mod use_v1; +pub mod utilize; +pub mod verify_collection; +pub mod verify_collection_v1; +pub mod verify_creator_v1; +pub mod verify_sized_collection_item; + +pub use approve_collection_authority::*; +pub use approve_use_authority::*; +pub use bubblegum_set_collection_size::*; +pub use burn_edition_nft::*; +pub use burn_nft::*; +pub use burn_v1::*; +pub use close_escrow_account::*; +pub use collect::*; +pub use convert_master_edition_v1_to_v2::*; +pub use create_escrow_account::*; +pub use create_master_edition_v3::*; +pub use create_metadata_account_v3::*; +pub use create_v1::*; +pub use delegate_authority_item_v1::*; +pub use delegate_collection_item_v1::*; +pub use delegate_collection_v1::*; +pub use delegate_data_item_v1::*; +pub use delegate_data_v1::*; +pub use delegate_locked_transfer_v1::*; +pub use delegate_programmable_config_item_v1::*; +pub use delegate_programmable_config_v1::*; +pub use delegate_sale_v1::*; +pub use delegate_staking_v1::*; +pub use delegate_standard_v1::*; +pub use delegate_transfer_v1::*; +pub use delegate_utility_v1::*; +pub use deprecated_mint_new_edition_from_master_edition_via_printing_token::*; +pub use freeze_delegated_account::*; +pub use lock_v1::*; +pub use migrate::*; +pub use mint_new_edition_from_master_edition_via_token::*; +pub use mint_new_edition_from_master_edition_via_vault_proxy::*; +pub use mint_v1::*; +pub use print_v1::*; +pub use puff_metadata::*; +pub use remove_creator_verification::*; +pub use revoke_authority_item_v1::*; +pub use revoke_collection_authority::*; +pub use revoke_collection_item_v1::*; +pub use revoke_collection_v1::*; +pub use revoke_data_item_v1::*; +pub use revoke_data_v1::*; +pub use revoke_locked_transfer_v1::*; +pub use revoke_migration_v1::*; +pub use revoke_programmable_config_item_v1::*; +pub use revoke_programmable_config_v1::*; +pub use revoke_sale_v1::*; +pub use revoke_staking_v1::*; +pub use revoke_standard_v1::*; +pub use revoke_transfer_v1::*; +pub use revoke_use_authority::*; +pub use revoke_utility_v1::*; +pub use set_and_verify_collection::*; +pub use set_and_verify_sized_collection_item::*; +pub use set_collection_size::*; +pub use set_token_standard::*; +pub use sign_metadata::*; +pub use thaw_delegated_account::*; +pub use transfer_out_of_escrow::*; +pub use transfer_v1::*; +pub use unlock_v1::*; +pub use unverify_collection::*; +pub use unverify_collection_v1::*; +pub use unverify_creator_v1::*; +pub use unverify_sized_collection_item::*; +pub use update_as_authority_item_delegate_v2::*; +pub use update_as_collection_delegate_v2::*; +pub use update_as_collection_item_delegate_v2::*; +pub use update_as_data_delegate_v2::*; +pub use update_as_data_item_delegate_v2::*; +pub use update_as_programmable_config_delegate_v2::*; +pub use update_as_programmable_config_item_delegate_v2::*; +pub use update_as_update_authority_v2::*; +pub use update_metadata_account_v2::*; +pub use update_primary_sale_happened_via_token::*; +pub use update_v1::*; +pub use use_v1::*; +pub use utilize::*; +pub use verify_collection::*; +pub use verify_collection_v1::*; +pub use verify_creator_v1::*; +pub use verify_sized_collection_item::*; diff --git a/clients/rust/src/generated/instructions/print_v1.rs b/clients/rust/src/generated/instructions/print_v1.rs new file mode 100644 index 00000000..b5358525 --- /dev/null +++ b/clients/rust/src/generated/instructions/print_v1.rs @@ -0,0 +1,801 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct PrintV1 { + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub edition_metadata: solana_program::pubkey::Pubkey, + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + pub edition: solana_program::pubkey::Pubkey, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub edition_mint: solana_program::pubkey::Pubkey, + /// Owner of the token account of new token + pub edition_token_account_owner: solana_program::pubkey::Pubkey, + /// Token account of new token + pub edition_token_account: solana_program::pubkey::Pubkey, + /// Mint authority of new mint + pub edition_mint_authority: solana_program::pubkey::Pubkey, + /// Token record account + pub edition_token_record: Option, + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: solana_program::pubkey::Pubkey, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + pub edition_marker_pda: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// owner of token account containing master token + pub master_token_account_owner: solana_program::pubkey::Pubkey, + /// token account containing token from master metadata mint + pub master_token_account: solana_program::pubkey::Pubkey, + /// Master record metadata account + pub master_metadata: solana_program::pubkey::Pubkey, + /// The update authority of the master edition. + pub update_authority: solana_program::pubkey::Pubkey, + /// Token program + pub spl_token_program: solana_program::pubkey::Pubkey, + /// SPL Associated Token Account program + pub spl_ata_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, +} + +impl PrintV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: PrintV1InstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(18); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.edition_token_account_owner, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.edition_mint_authority, + true, + )); + if let Some(edition_token_record) = self.edition_token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + edition_token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.master_edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.edition_marker_pda, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_token_account_owner, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.master_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_ata_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct PrintV1InstructionArgs { + discriminator: u8, + print_v1_discriminator: u8, + pub edition_arg: u64, +} + +impl PrintV1InstructionArgs { + pub fn new(edition_arg: u64) -> Self { + Self { + discriminator: 55, + print_v1_discriminator: 0, + edition_arg, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct PrintV1Builder { + edition_metadata: Option, + edition: Option, + edition_mint: Option, + edition_token_account_owner: Option, + edition_token_account: Option, + edition_mint_authority: Option, + edition_token_record: Option, + master_edition: Option, + edition_marker_pda: Option, + payer: Option, + master_token_account_owner: Option, + master_token_account: Option, + master_metadata: Option, + update_authority: Option, + spl_token_program: Option, + spl_ata_program: Option, + sysvar_instructions: Option, + system_program: Option, + edition_arg: Option, +} + +impl PrintV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn edition_metadata( + &mut self, + edition_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_metadata = Some(edition_metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn edition_mint(&mut self, edition_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition_mint = Some(edition_mint); + self + } + pub fn edition_token_account_owner( + &mut self, + edition_token_account_owner: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_token_account_owner = Some(edition_token_account_owner); + self + } + pub fn edition_token_account( + &mut self, + edition_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_token_account = Some(edition_token_account); + self + } + pub fn edition_mint_authority( + &mut self, + edition_mint_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_mint_authority = Some(edition_mint_authority); + self + } + pub fn edition_token_record( + &mut self, + edition_token_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_token_record = Some(edition_token_record); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn edition_marker_pda( + &mut self, + edition_marker_pda: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.edition_marker_pda = Some(edition_marker_pda); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn master_token_account_owner( + &mut self, + master_token_account_owner: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_token_account_owner = Some(master_token_account_owner); + self + } + pub fn master_token_account( + &mut self, + master_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_token_account = Some(master_token_account); + self + } + pub fn master_metadata( + &mut self, + master_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.master_metadata = Some(master_metadata); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn spl_ata_program( + &mut self, + spl_ata_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_ata_program = Some(spl_ata_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn edition_arg(&mut self, edition_arg: u64) -> &mut Self { + self.edition_arg = Some(edition_arg); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = PrintV1 { + edition_metadata: self.edition_metadata.expect("edition_metadata is not set"), + edition: self.edition.expect("edition is not set"), + edition_mint: self.edition_mint.expect("edition_mint is not set"), + edition_token_account_owner: self + .edition_token_account_owner + .expect("edition_token_account_owner is not set"), + edition_token_account: self + .edition_token_account + .expect("edition_token_account is not set"), + edition_mint_authority: self + .edition_mint_authority + .expect("edition_mint_authority is not set"), + edition_token_record: self.edition_token_record, + master_edition: self.master_edition.expect("master_edition is not set"), + edition_marker_pda: self + .edition_marker_pda + .expect("edition_marker_pda is not set"), + payer: self.payer.expect("payer is not set"), + master_token_account_owner: self + .master_token_account_owner + .expect("master_token_account_owner is not set"), + master_token_account: self + .master_token_account + .expect("master_token_account is not set"), + master_metadata: self.master_metadata.expect("master_metadata is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + spl_ata_program: self.spl_ata_program.unwrap_or(solana_program::pubkey!( + "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + )), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + }; + let args = + PrintV1InstructionArgs::new(self.edition_arg.clone().expect("edition_arg is not set")); + + accounts.instruction(args) + } +} + +/// `print_v1` CPI instruction. +pub struct PrintV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// New Metadata key (pda of ['metadata', program id, mint id]) + pub edition_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + pub edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Owner of the token account of new token + pub edition_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of new token + pub edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint authority of new mint + pub edition_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Token record account + pub edition_token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + pub master_edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + pub edition_marker_pda: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// owner of token account containing master token + pub master_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// token account containing token from master metadata mint + pub master_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Master record metadata account + pub master_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// The update authority of the master edition. + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Associated Token Account program + pub spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// The arguments for the instruction. + pub __args: PrintV1InstructionArgs, +} + +impl<'a> PrintV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(18); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.edition_token_account_owner.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.edition_mint_authority.key, + true, + )); + if let Some(edition_token_record) = self.edition_token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *edition_token_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.master_edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.edition_marker_pda.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_token_account_owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.master_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_ata_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(18 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.edition_metadata.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.edition_mint.clone()); + account_infos.push(self.edition_token_account_owner.clone()); + account_infos.push(self.edition_token_account.clone()); + account_infos.push(self.edition_mint_authority.clone()); + if let Some(edition_token_record) = self.edition_token_record { + account_infos.push(edition_token_record.clone()); + } + account_infos.push(self.master_edition.clone()); + account_infos.push(self.edition_marker_pda.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.master_token_account_owner.clone()); + account_infos.push(self.master_token_account.clone()); + account_infos.push(self.master_metadata.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.spl_token_program.clone()); + account_infos.push(self.spl_ata_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + account_infos.push(self.system_program.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `print_v1` CPI instruction builder. +pub struct PrintV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> PrintV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(PrintV1CpiBuilderInstruction { + __program: program, + edition_metadata: None, + edition: None, + edition_mint: None, + edition_token_account_owner: None, + edition_token_account: None, + edition_mint_authority: None, + edition_token_record: None, + master_edition: None, + edition_marker_pda: None, + payer: None, + master_token_account_owner: None, + master_token_account: None, + master_metadata: None, + update_authority: None, + spl_token_program: None, + spl_ata_program: None, + sysvar_instructions: None, + system_program: None, + edition_arg: None, + }); + Self { instruction } + } + pub fn edition_metadata( + &mut self, + edition_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_metadata = Some(edition_metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn edition_mint( + &mut self, + edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_mint = Some(edition_mint); + self + } + pub fn edition_token_account_owner( + &mut self, + edition_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_token_account_owner = Some(edition_token_account_owner); + self + } + pub fn edition_token_account( + &mut self, + edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_token_account = Some(edition_token_account); + self + } + pub fn edition_mint_authority( + &mut self, + edition_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_mint_authority = Some(edition_mint_authority); + self + } + pub fn edition_token_record( + &mut self, + edition_token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_token_record = Some(edition_token_record); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn edition_marker_pda( + &mut self, + edition_marker_pda: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition_marker_pda = Some(edition_marker_pda); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn master_token_account_owner( + &mut self, + master_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_token_account_owner = Some(master_token_account_owner); + self + } + pub fn master_token_account( + &mut self, + master_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_token_account = Some(master_token_account); + self + } + pub fn master_metadata( + &mut self, + master_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_metadata = Some(master_metadata); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn spl_ata_program( + &mut self, + spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_ata_program = Some(spl_ata_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn edition_arg(&mut self, edition_arg: u64) -> &mut Self { + self.instruction.edition_arg = Some(edition_arg); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> PrintV1Cpi<'a> { + let args = PrintV1InstructionArgs::new( + self.instruction + .edition_arg + .clone() + .expect("edition_arg is not set"), + ); + + PrintV1Cpi { + __program: self.instruction.__program, + + edition_metadata: self + .instruction + .edition_metadata + .expect("edition_metadata is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + edition_mint: self + .instruction + .edition_mint + .expect("edition_mint is not set"), + + edition_token_account_owner: self + .instruction + .edition_token_account_owner + .expect("edition_token_account_owner is not set"), + + edition_token_account: self + .instruction + .edition_token_account + .expect("edition_token_account is not set"), + + edition_mint_authority: self + .instruction + .edition_mint_authority + .expect("edition_mint_authority is not set"), + + edition_token_record: self.instruction.edition_token_record, + + master_edition: self + .instruction + .master_edition + .expect("master_edition is not set"), + + edition_marker_pda: self + .instruction + .edition_marker_pda + .expect("edition_marker_pda is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + master_token_account_owner: self + .instruction + .master_token_account_owner + .expect("master_token_account_owner is not set"), + + master_token_account: self + .instruction + .master_token_account + .expect("master_token_account is not set"), + + master_metadata: self + .instruction + .master_metadata + .expect("master_metadata is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + + spl_ata_program: self + .instruction + .spl_ata_program + .expect("spl_ata_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + __args: args, + } + } +} + +struct PrintV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + edition_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_token_account_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_marker_pda: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_token_account_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_ata_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_arg: Option, +} diff --git a/clients/rust/src/generated/instructions/puff_metadata.rs b/clients/rust/src/generated/instructions/puff_metadata.rs new file mode 100644 index 00000000..92d671fb --- /dev/null +++ b/clients/rust/src/generated/instructions/puff_metadata.rs @@ -0,0 +1,147 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct PuffMetadata { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, +} + +impl PuffMetadata { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = PuffMetadataInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(1); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct PuffMetadataInstructionArgs { + discriminator: u8, +} + +impl PuffMetadataInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 14 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct PuffMetadataBuilder { + metadata: Option, +} + +impl PuffMetadataBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = PuffMetadata { + metadata: self.metadata.expect("metadata is not set"), + }; + + accounts.instruction() + } +} + +/// `puff_metadata` CPI instruction. +pub struct PuffMetadataCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> PuffMetadataCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = PuffMetadataInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(1); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(1 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `puff_metadata` CPI instruction builder. +pub struct PuffMetadataCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> PuffMetadataCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(PuffMetadataCpiBuilderInstruction { + __program: program, + metadata: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> PuffMetadataCpi<'a> { + PuffMetadataCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + } + } +} + +struct PuffMetadataCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/remove_creator_verification.rs b/clients/rust/src/generated/instructions/remove_creator_verification.rs new file mode 100644 index 00000000..32aaa727 --- /dev/null +++ b/clients/rust/src/generated/instructions/remove_creator_verification.rs @@ -0,0 +1,177 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RemoveCreatorVerification { + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Creator + pub creator: solana_program::pubkey::Pubkey, +} + +impl RemoveCreatorVerification { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RemoveCreatorVerificationInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.creator, + true, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RemoveCreatorVerificationInstructionArgs { + discriminator: u8, +} + +impl RemoveCreatorVerificationInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 28 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RemoveCreatorVerificationBuilder { + metadata: Option, + creator: Option, +} + +impl RemoveCreatorVerificationBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self { + self.creator = Some(creator); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RemoveCreatorVerification { + metadata: self.metadata.expect("metadata is not set"), + creator: self.creator.expect("creator is not set"), + }; + + accounts.instruction() + } +} + +/// `remove_creator_verification` CPI instruction. +pub struct RemoveCreatorVerificationCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Creator + pub creator: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> RemoveCreatorVerificationCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RemoveCreatorVerificationInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.creator.key, + true, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(2 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.creator.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `remove_creator_verification` CPI instruction builder. +pub struct RemoveCreatorVerificationCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RemoveCreatorVerificationCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RemoveCreatorVerificationCpiBuilderInstruction { + __program: program, + metadata: None, + creator: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn creator( + &mut self, + creator: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.creator = Some(creator); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RemoveCreatorVerificationCpi<'a> { + RemoveCreatorVerificationCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + creator: self.instruction.creator.expect("creator is not set"), + } + } +} + +struct RemoveCreatorVerificationCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + creator: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs new file mode 100644 index 00000000..b8364cd2 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeAuthorityItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeAuthorityItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeAuthorityItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeAuthorityItemV1InstructionArgs { + discriminator: u8, + revoke_authority_item_v1_discriminator: u8, +} + +impl RevokeAuthorityItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_authority_item_v1_discriminator: 10, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeAuthorityItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeAuthorityItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeAuthorityItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_authority_item_v1` CPI instruction. +pub struct RevokeAuthorityItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeAuthorityItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeAuthorityItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_authority_item_v1` CPI instruction builder. +pub struct RevokeAuthorityItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeAuthorityItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeAuthorityItemV1Cpi<'a> { + RevokeAuthorityItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeAuthorityItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_collection_authority.rs b/clients/rust/src/generated/instructions/revoke_collection_authority.rs new file mode 100644 index 00000000..fd0f555b --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_collection_authority.rs @@ -0,0 +1,285 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeCollectionAuthority { + /// Collection Authority Record PDA + pub collection_authority_record: solana_program::pubkey::Pubkey, + /// Delegated Collection Authority + pub delegate_authority: solana_program::pubkey::Pubkey, + /// Update Authority, or Delegated Authority, of Collection NFT + pub revoke_authority: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of Metadata + pub mint: solana_program::pubkey::Pubkey, +} + +impl RevokeCollectionAuthority { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeCollectionAuthorityInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority_record, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.delegate_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.revoke_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeCollectionAuthorityInstructionArgs { + discriminator: u8, +} + +impl RevokeCollectionAuthorityInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 24 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeCollectionAuthorityBuilder { + collection_authority_record: Option, + delegate_authority: Option, + revoke_authority: Option, + metadata: Option, + mint: Option, +} + +impl RevokeCollectionAuthorityBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + pub fn delegate_authority( + &mut self, + delegate_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_authority = Some(delegate_authority); + self + } + pub fn revoke_authority( + &mut self, + revoke_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.revoke_authority = Some(revoke_authority); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeCollectionAuthority { + collection_authority_record: self + .collection_authority_record + .expect("collection_authority_record is not set"), + delegate_authority: self + .delegate_authority + .expect("delegate_authority is not set"), + revoke_authority: self.revoke_authority.expect("revoke_authority is not set"), + metadata: self.metadata.expect("metadata is not set"), + mint: self.mint.expect("mint is not set"), + }; + + accounts.instruction() + } +} + +/// `revoke_collection_authority` CPI instruction. +pub struct RevokeCollectionAuthorityCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegated Collection Authority + pub delegate_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Update Authority, or Delegated Authority, of Collection NFT + pub revoke_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of Metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> RevokeCollectionAuthorityCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeCollectionAuthorityInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority_record.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.delegate_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.revoke_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(5 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.collection_authority_record.clone()); + account_infos.push(self.delegate_authority.clone()); + account_infos.push(self.revoke_authority.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.mint.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_collection_authority` CPI instruction builder. +pub struct RevokeCollectionAuthorityCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeCollectionAuthorityCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeCollectionAuthorityCpiBuilderInstruction { + __program: program, + collection_authority_record: None, + delegate_authority: None, + revoke_authority: None, + metadata: None, + mint: None, + }); + Self { instruction } + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + pub fn delegate_authority( + &mut self, + delegate_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_authority = Some(delegate_authority); + self + } + pub fn revoke_authority( + &mut self, + revoke_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.revoke_authority = Some(revoke_authority); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeCollectionAuthorityCpi<'a> { + RevokeCollectionAuthorityCpi { + __program: self.instruction.__program, + + collection_authority_record: self + .instruction + .collection_authority_record + .expect("collection_authority_record is not set"), + + delegate_authority: self + .instruction + .delegate_authority + .expect("delegate_authority is not set"), + + revoke_authority: self + .instruction + .revoke_authority + .expect("revoke_authority is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + } + } +} + +struct RevokeCollectionAuthorityCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + revoke_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs new file mode 100644 index 00000000..69b1aa5e --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeCollectionItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeCollectionItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeCollectionItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeCollectionItemV1InstructionArgs { + discriminator: u8, + revoke_collection_item_v1_discriminator: u8, +} + +impl RevokeCollectionItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_collection_item_v1_discriminator: 12, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeCollectionItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeCollectionItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeCollectionItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_collection_item_v1` CPI instruction. +pub struct RevokeCollectionItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeCollectionItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeCollectionItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_collection_item_v1` CPI instruction builder. +pub struct RevokeCollectionItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeCollectionItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeCollectionItemV1Cpi<'a> { + RevokeCollectionItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeCollectionItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_collection_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_v1.rs new file mode 100644 index 00000000..de8683bb --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_collection_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeCollectionV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeCollectionV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeCollectionV1InstructionArgs { + discriminator: u8, + revoke_collection_v1_discriminator: u8, +} + +impl RevokeCollectionV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_collection_v1_discriminator: 0, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeCollectionV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeCollectionV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeCollectionV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_collection_v1` CPI instruction. +pub struct RevokeCollectionV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeCollectionV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_collection_v1` CPI instruction builder. +pub struct RevokeCollectionV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeCollectionV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeCollectionV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeCollectionV1Cpi<'a> { + RevokeCollectionV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeCollectionV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs new file mode 100644 index 00000000..5a7967f7 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeDataItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeDataItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeDataItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeDataItemV1InstructionArgs { + discriminator: u8, + revoke_data_item_v1_discriminator: u8, +} + +impl RevokeDataItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_data_item_v1_discriminator: 11, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeDataItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeDataItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeDataItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_data_item_v1` CPI instruction. +pub struct RevokeDataItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeDataItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeDataItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_data_item_v1` CPI instruction builder. +pub struct RevokeDataItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeDataItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeDataItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeDataItemV1Cpi<'a> { + RevokeDataItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeDataItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_data_v1.rs b/clients/rust/src/generated/instructions/revoke_data_v1.rs new file mode 100644 index 00000000..b02ef50e --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_data_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeDataV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeDataV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeDataV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeDataV1InstructionArgs { + discriminator: u8, + revoke_data_v1_discriminator: u8, +} + +impl RevokeDataV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_data_v1_discriminator: 3, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeDataV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeDataV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeDataV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_data_v1` CPI instruction. +pub struct RevokeDataV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeDataV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeDataV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_data_v1` CPI instruction builder. +pub struct RevokeDataV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeDataV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeDataV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeDataV1Cpi<'a> { + RevokeDataV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeDataV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs new file mode 100644 index 00000000..92be9151 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs @@ -0,0 +1,625 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeLockedTransferV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeLockedTransferV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeLockedTransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeLockedTransferV1InstructionArgs { + discriminator: u8, + revoke_locked_transfer_v1_discriminator: u8, +} + +impl RevokeLockedTransferV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_locked_transfer_v1_discriminator: 7, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeLockedTransferV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeLockedTransferV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeLockedTransferV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_locked_transfer_v1` CPI instruction. +pub struct RevokeLockedTransferV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeLockedTransferV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeLockedTransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_locked_transfer_v1` CPI instruction builder. +pub struct RevokeLockedTransferV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeLockedTransferV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeLockedTransferV1Cpi<'a> { + RevokeLockedTransferV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeLockedTransferV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_migration_v1.rs b/clients/rust/src/generated/instructions/revoke_migration_v1.rs new file mode 100644 index 00000000..01990d4f --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_migration_v1.rs @@ -0,0 +1,625 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeMigrationV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeMigrationV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeMigrationV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeMigrationV1InstructionArgs { + discriminator: u8, + revoke_migration_v1_discriminator: u8, +} + +impl RevokeMigrationV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_migration_v1_discriminator: 9, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeMigrationV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeMigrationV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeMigrationV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_migration_v1` CPI instruction. +pub struct RevokeMigrationV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeMigrationV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeMigrationV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_migration_v1` CPI instruction builder. +pub struct RevokeMigrationV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeMigrationV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeMigrationV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeMigrationV1Cpi<'a> { + RevokeMigrationV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeMigrationV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs new file mode 100644 index 00000000..9b047783 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeProgrammableConfigItemV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeProgrammableConfigItemV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeProgrammableConfigItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeProgrammableConfigItemV1InstructionArgs { + discriminator: u8, + revoke_programmable_config_item_v1_discriminator: u8, +} + +impl RevokeProgrammableConfigItemV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_programmable_config_item_v1_discriminator: 13, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeProgrammableConfigItemV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeProgrammableConfigItemV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeProgrammableConfigItemV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_programmable_config_item_v1` CPI instruction. +pub struct RevokeProgrammableConfigItemV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeProgrammableConfigItemV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_programmable_config_item_v1` CPI instruction builder. +pub struct RevokeProgrammableConfigItemV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeProgrammableConfigItemV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeProgrammableConfigItemV1Cpi<'a> { + RevokeProgrammableConfigItemV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeProgrammableConfigItemV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs new file mode 100644 index 00000000..c9595072 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs @@ -0,0 +1,643 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeProgrammableConfigV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: Option, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeProgrammableConfigV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeProgrammableConfigV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeProgrammableConfigV1InstructionArgs { + discriminator: u8, + revoke_programmable_config_v1_discriminator: u8, +} + +impl RevokeProgrammableConfigV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_programmable_config_v1_discriminator: 8, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeProgrammableConfigV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeProgrammableConfigV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeProgrammableConfigV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_programmable_config_v1` CPI instruction. +pub struct RevokeProgrammableConfigV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeProgrammableConfigV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeProgrammableConfigV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_programmable_config_v1` CPI instruction builder. +pub struct RevokeProgrammableConfigV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeProgrammableConfigV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeProgrammableConfigV1Cpi<'a> { + RevokeProgrammableConfigV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeProgrammableConfigV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_sale_v1.rs b/clients/rust/src/generated/instructions/revoke_sale_v1.rs new file mode 100644 index 00000000..7a9e7ad2 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_sale_v1.rs @@ -0,0 +1,625 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeSaleV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeSaleV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeSaleV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeSaleV1InstructionArgs { + discriminator: u8, + revoke_sale_v1_discriminator: u8, +} + +impl RevokeSaleV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_sale_v1_discriminator: 1, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeSaleV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeSaleV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeSaleV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_sale_v1` CPI instruction. +pub struct RevokeSaleV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeSaleV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeSaleV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_sale_v1` CPI instruction builder. +pub struct RevokeSaleV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeSaleV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeSaleV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeSaleV1Cpi<'a> { + RevokeSaleV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeSaleV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_staking_v1.rs b/clients/rust/src/generated/instructions/revoke_staking_v1.rs new file mode 100644 index 00000000..3680f6dd --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_staking_v1.rs @@ -0,0 +1,625 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeStakingV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeStakingV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeStakingV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeStakingV1InstructionArgs { + discriminator: u8, + revoke_staking_v1_discriminator: u8, +} + +impl RevokeStakingV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_staking_v1_discriminator: 5, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeStakingV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeStakingV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeStakingV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_staking_v1` CPI instruction. +pub struct RevokeStakingV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeStakingV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeStakingV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_staking_v1` CPI instruction builder. +pub struct RevokeStakingV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeStakingV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeStakingV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeStakingV1Cpi<'a> { + RevokeStakingV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeStakingV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_standard_v1.rs b/clients/rust/src/generated/instructions/revoke_standard_v1.rs new file mode 100644 index 00000000..44abed77 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_standard_v1.rs @@ -0,0 +1,630 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeStandardV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeStandardV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeStandardV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeStandardV1InstructionArgs { + discriminator: u8, + revoke_standard_v1_discriminator: u8, +} + +impl RevokeStandardV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_standard_v1_discriminator: 6, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeStandardV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeStandardV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeStandardV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_standard_v1` CPI instruction. +pub struct RevokeStandardV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeStandardV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeStandardV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_standard_v1` CPI instruction builder. +pub struct RevokeStandardV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeStandardV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeStandardV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeStandardV1Cpi<'a> { + RevokeStandardV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeStandardV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs new file mode 100644 index 00000000..5dd642d8 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs @@ -0,0 +1,625 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeTransferV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeTransferV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeTransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeTransferV1InstructionArgs { + discriminator: u8, + revoke_transfer_v1_discriminator: u8, +} + +impl RevokeTransferV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_transfer_v1_discriminator: 2, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeTransferV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeTransferV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeTransferV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_transfer_v1` CPI instruction. +pub struct RevokeTransferV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeTransferV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeTransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_transfer_v1` CPI instruction builder. +pub struct RevokeTransferV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeTransferV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeTransferV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeTransferV1Cpi<'a> { + RevokeTransferV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeTransferV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_use_authority.rs b/clients/rust/src/generated/instructions/revoke_use_authority.rs new file mode 100644 index 00000000..7375d982 --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_use_authority.rs @@ -0,0 +1,412 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeUseAuthority { + /// Use Authority Record PDA + pub use_authority_record: solana_program::pubkey::Pubkey, + /// Owner + pub owner: solana_program::pubkey::Pubkey, + /// A Use Authority + pub user: solana_program::pubkey::Pubkey, + /// Owned Token Account Of Mint + pub owner_token_account: solana_program::pubkey::Pubkey, + /// Mint of Metadata + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: Option, +} + +impl RevokeUseAuthority { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeUseAuthorityInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + self.use_authority_record, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.owner, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.user, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.owner_token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + rent, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeUseAuthorityInstructionArgs { + discriminator: u8, +} + +impl RevokeUseAuthorityInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 21 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeUseAuthorityBuilder { + use_authority_record: Option, + owner: Option, + user: Option, + owner_token_account: Option, + mint: Option, + metadata: Option, + token_program: Option, + system_program: Option, + rent: Option, +} + +impl RevokeUseAuthorityBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn use_authority_record( + &mut self, + use_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.use_authority_record = Some(use_authority_record); + self + } + pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.owner = Some(owner); + self + } + pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self { + self.user = Some(user); + self + } + pub fn owner_token_account( + &mut self, + owner_token_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.owner_token_account = Some(owner_token_account); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeUseAuthority { + use_authority_record: self + .use_authority_record + .expect("use_authority_record is not set"), + owner: self.owner.expect("owner is not set"), + user: self.user.expect("user is not set"), + owner_token_account: self + .owner_token_account + .expect("owner_token_account is not set"), + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent, + }; + + accounts.instruction() + } +} + +/// `revoke_use_authority` CPI instruction. +pub struct RevokeUseAuthorityCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Use Authority Record PDA + pub use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + /// Owner + pub owner: &'a solana_program::account_info::AccountInfo<'a>, + /// A Use Authority + pub user: &'a solana_program::account_info::AccountInfo<'a>, + /// Owned Token Account Of Mint + pub owner_token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of Metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeUseAuthorityCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeUseAuthorityInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(9); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.use_authority_record.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.user.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.owner_token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + if let Some(rent) = self.rent { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *rent.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(9 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.use_authority_record.clone()); + account_infos.push(self.owner.clone()); + account_infos.push(self.user.clone()); + account_infos.push(self.owner_token_account.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.system_program.clone()); + if let Some(rent) = self.rent { + account_infos.push(rent.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_use_authority` CPI instruction builder. +pub struct RevokeUseAuthorityCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeUseAuthorityCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeUseAuthorityCpiBuilderInstruction { + __program: program, + use_authority_record: None, + owner: None, + user: None, + owner_token_account: None, + mint: None, + metadata: None, + token_program: None, + system_program: None, + rent: None, + }); + Self { instruction } + } + pub fn use_authority_record( + &mut self, + use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.use_authority_record = Some(use_authority_record); + self + } + pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.owner = Some(owner); + self + } + pub fn user(&mut self, user: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.user = Some(user); + self + } + pub fn owner_token_account( + &mut self, + owner_token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.owner_token_account = Some(owner_token_account); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeUseAuthorityCpi<'a> { + RevokeUseAuthorityCpi { + __program: self.instruction.__program, + + use_authority_record: self + .instruction + .use_authority_record + .expect("use_authority_record is not set"), + + owner: self.instruction.owner.expect("owner is not set"), + + user: self.instruction.user.expect("user is not set"), + + owner_token_account: self + .instruction + .owner_token_account + .expect("owner_token_account is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent, + } + } +} + +struct RevokeUseAuthorityCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + use_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + user: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/revoke_utility_v1.rs b/clients/rust/src/generated/instructions/revoke_utility_v1.rs new file mode 100644 index 00000000..b5a3567f --- /dev/null +++ b/clients/rust/src/generated/instructions/revoke_utility_v1.rs @@ -0,0 +1,625 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct RevokeUtilityV1 { + /// Delegate record account + pub delegate_record: Option, + /// Owner of the delegated account + pub delegate: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Master Edition account + pub master_edition: Option, + /// Token record account + pub token_record: Option, + /// Mint of metadata + pub mint: solana_program::pubkey::Pubkey, + /// Token account of mint + pub token: solana_program::pubkey::Pubkey, + /// Update authority or token owner + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl RevokeUtilityV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = RevokeUtilityV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.delegate, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct RevokeUtilityV1InstructionArgs { + discriminator: u8, + revoke_utility_v1_discriminator: u8, +} + +impl RevokeUtilityV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 45, + revoke_utility_v1_discriminator: 4, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct RevokeUtilityV1Builder { + delegate_record: Option, + delegate: Option, + metadata: Option, + master_edition: Option, + token_record: Option, + mint: Option, + token: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, +} + +impl RevokeUtilityV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.master_edition = Some(master_edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = RevokeUtilityV1 { + delegate_record: self.delegate_record, + delegate: self.delegate.expect("delegate is not set"), + metadata: self.metadata.expect("metadata is not set"), + master_edition: self.master_edition, + token_record: self.token_record, + mint: self.mint.expect("mint is not set"), + token: self.token.expect("token is not set"), + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `revoke_utility_v1` CPI instruction. +pub struct RevokeUtilityV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record account + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner of the delegated account + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Master Edition account + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account of mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or token owner + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> RevokeUtilityV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = RevokeUtilityV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(14); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.delegate.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(master_edition) = self.master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *master_edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(14 + 1); + account_infos.push(self.__program.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.delegate.clone()); + account_infos.push(self.metadata.clone()); + if let Some(master_edition) = self.master_edition { + account_infos.push(master_edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `revoke_utility_v1` CPI instruction builder. +pub struct RevokeUtilityV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> RevokeUtilityV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(RevokeUtilityV1CpiBuilderInstruction { + __program: program, + delegate_record: None, + delegate: None, + metadata: None, + master_edition: None, + token_record: None, + mint: None, + token: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + }); + Self { instruction } + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn master_edition( + &mut self, + master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.master_edition = Some(master_edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> RevokeUtilityV1Cpi<'a> { + RevokeUtilityV1Cpi { + __program: self.instruction.__program, + + delegate_record: self.instruction.delegate_record, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + master_edition: self.instruction.master_edition, + + token_record: self.instruction.token_record, + + mint: self.instruction.mint.expect("mint is not set"), + + token: self.instruction.token.expect("token is not set"), + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct RevokeUtilityV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/set_and_verify_collection.rs b/clients/rust/src/generated/instructions/set_and_verify_collection.rs new file mode 100644 index 00000000..019df651 --- /dev/null +++ b/clients/rust/src/generated/instructions/set_and_verify_collection.rs @@ -0,0 +1,401 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct SetAndVerifyCollection { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Collection Update authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// Update Authority of Collection NFT and NFT + pub update_authority: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection: solana_program::pubkey::Pubkey, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl SetAndVerifyCollection { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = SetAndVerifyCollectionInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_master_edition_account, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct SetAndVerifyCollectionInstructionArgs { + discriminator: u8, +} + +impl SetAndVerifyCollectionInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 25 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct SetAndVerifyCollectionBuilder { + metadata: Option, + collection_authority: Option, + payer: Option, + update_authority: Option, + collection_mint: Option, + collection: Option, + collection_master_edition_account: Option, + collection_authority_record: Option, +} + +impl SetAndVerifyCollectionBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition_account = Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = SetAndVerifyCollection { + metadata: self.metadata.expect("metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + payer: self.payer.expect("payer is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection: self.collection.expect("collection is not set"), + collection_master_edition_account: self + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + collection_authority_record: self.collection_authority_record, + }; + + accounts.instruction() + } +} + +/// `set_and_verify_collection` CPI instruction. +pub struct SetAndVerifyCollectionCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Update authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Update Authority of Collection NFT and NFT + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> SetAndVerifyCollectionCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = SetAndVerifyCollectionInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_master_edition_account.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(8 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.collection.clone()); + account_infos.push(self.collection_master_edition_account.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `set_and_verify_collection` CPI instruction builder. +pub struct SetAndVerifyCollectionCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(SetAndVerifyCollectionCpiBuilderInstruction { + __program: program, + metadata: None, + collection_authority: None, + payer: None, + update_authority: None, + collection_mint: None, + collection: None, + collection_master_edition_account: None, + collection_authority_record: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection( + &mut self, + collection: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition_account = + Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> SetAndVerifyCollectionCpi<'a> { + SetAndVerifyCollectionCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection: self.instruction.collection.expect("collection is not set"), + + collection_master_edition_account: self + .instruction + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + } + } +} + +struct SetAndVerifyCollectionCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs new file mode 100644 index 00000000..de5bc086 --- /dev/null +++ b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs @@ -0,0 +1,401 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct SetAndVerifySizedCollectionItem { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Collection Update authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// Update Authority of Collection NFT and NFT + pub update_authority: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection: solana_program::pubkey::Pubkey, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl SetAndVerifySizedCollectionItem { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = SetAndVerifySizedCollectionItemInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_master_edition_account, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct SetAndVerifySizedCollectionItemInstructionArgs { + discriminator: u8, +} + +impl SetAndVerifySizedCollectionItemInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 32 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct SetAndVerifySizedCollectionItemBuilder { + metadata: Option, + collection_authority: Option, + payer: Option, + update_authority: Option, + collection_mint: Option, + collection: Option, + collection_master_edition_account: Option, + collection_authority_record: Option, +} + +impl SetAndVerifySizedCollectionItemBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition_account = Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = SetAndVerifySizedCollectionItem { + metadata: self.metadata.expect("metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + payer: self.payer.expect("payer is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection: self.collection.expect("collection is not set"), + collection_master_edition_account: self + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + collection_authority_record: self.collection_authority_record, + }; + + accounts.instruction() + } +} + +/// `set_and_verify_sized_collection_item` CPI instruction. +pub struct SetAndVerifySizedCollectionItemCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Update authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Update Authority of Collection NFT and NFT + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> SetAndVerifySizedCollectionItemCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = SetAndVerifySizedCollectionItemInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_master_edition_account.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(8 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.collection.clone()); + account_infos.push(self.collection_master_edition_account.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `set_and_verify_sized_collection_item` CPI instruction builder. +pub struct SetAndVerifySizedCollectionItemCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(SetAndVerifySizedCollectionItemCpiBuilderInstruction { + __program: program, + metadata: None, + collection_authority: None, + payer: None, + update_authority: None, + collection_mint: None, + collection: None, + collection_master_edition_account: None, + collection_authority_record: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection( + &mut self, + collection: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition_account = + Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> SetAndVerifySizedCollectionItemCpi<'a> { + SetAndVerifySizedCollectionItemCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection: self.instruction.collection.expect("collection is not set"), + + collection_master_edition_account: self + .instruction + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + } + } +} + +struct SetAndVerifySizedCollectionItemCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/set_collection_size.rs b/clients/rust/src/generated/instructions/set_collection_size.rs new file mode 100644 index 00000000..41e92060 --- /dev/null +++ b/clients/rust/src/generated/instructions/set_collection_size.rs @@ -0,0 +1,314 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::SetCollectionSizeArgs; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct SetCollectionSize { + /// Collection Metadata account + pub collection_metadata: solana_program::pubkey::Pubkey, + /// Collection Update authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl SetCollectionSize { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: SetCollectionSizeInstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(4); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct SetCollectionSizeInstructionArgs { + discriminator: u8, + pub set_collection_size_args: SetCollectionSizeArgs, +} + +impl SetCollectionSizeInstructionArgs { + pub fn new(set_collection_size_args: SetCollectionSizeArgs) -> Self { + Self { + discriminator: 34, + set_collection_size_args, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct SetCollectionSizeBuilder { + collection_metadata: Option, + collection_authority: Option, + collection_mint: Option, + collection_authority_record: Option, + set_collection_size_args: Option, +} + +impl SetCollectionSizeBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + pub fn set_collection_size_args( + &mut self, + set_collection_size_args: SetCollectionSizeArgs, + ) -> &mut Self { + self.set_collection_size_args = Some(set_collection_size_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = SetCollectionSize { + collection_metadata: self + .collection_metadata + .expect("collection_metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection_authority_record: self.collection_authority_record, + }; + let args = SetCollectionSizeInstructionArgs::new( + self.set_collection_size_args + .clone() + .expect("set_collection_size_args is not set"), + ); + + accounts.instruction(args) + } +} + +/// `set_collection_size` CPI instruction. +pub struct SetCollectionSizeCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Metadata account + pub collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Update authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: SetCollectionSizeInstructionArgs, +} + +impl<'a> SetCollectionSizeCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(4); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(4 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.collection_metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.collection_mint.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `set_collection_size` CPI instruction builder. +pub struct SetCollectionSizeCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> SetCollectionSizeCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(SetCollectionSizeCpiBuilderInstruction { + __program: program, + collection_metadata: None, + collection_authority: None, + collection_mint: None, + collection_authority_record: None, + set_collection_size_args: None, + }); + Self { instruction } + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + pub fn set_collection_size_args( + &mut self, + set_collection_size_args: SetCollectionSizeArgs, + ) -> &mut Self { + self.instruction.set_collection_size_args = Some(set_collection_size_args); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> SetCollectionSizeCpi<'a> { + let args = SetCollectionSizeInstructionArgs::new( + self.instruction + .set_collection_size_args + .clone() + .expect("set_collection_size_args is not set"), + ); + + SetCollectionSizeCpi { + __program: self.instruction.__program, + + collection_metadata: self + .instruction + .collection_metadata + .expect("collection_metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + __args: args, + } + } +} + +struct SetCollectionSizeCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + set_collection_size_args: Option, +} diff --git a/clients/rust/src/generated/instructions/set_token_standard.rs b/clients/rust/src/generated/instructions/set_token_standard.rs new file mode 100644 index 00000000..539d3f51 --- /dev/null +++ b/clients/rust/src/generated/instructions/set_token_standard.rs @@ -0,0 +1,254 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct SetTokenStandard { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Metadata update authority + pub update_authority: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, +} + +impl SetTokenStandard { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = SetTokenStandardInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(4); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct SetTokenStandardInstructionArgs { + discriminator: u8, +} + +impl SetTokenStandardInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 35 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct SetTokenStandardBuilder { + metadata: Option, + update_authority: Option, + mint: Option, + edition: Option, +} + +impl SetTokenStandardBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = SetTokenStandard { + metadata: self.metadata.expect("metadata is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + mint: self.mint.expect("mint is not set"), + edition: self.edition, + }; + + accounts.instruction() + } +} + +/// `set_token_standard` CPI instruction. +pub struct SetTokenStandardCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata update authority + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> SetTokenStandardCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = SetTokenStandardInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(4); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(4 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.update_authority.clone()); + account_infos.push(self.mint.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `set_token_standard` CPI instruction builder. +pub struct SetTokenStandardCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> SetTokenStandardCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(SetTokenStandardCpiBuilderInstruction { + __program: program, + metadata: None, + update_authority: None, + mint: None, + edition: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> SetTokenStandardCpi<'a> { + SetTokenStandardCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + edition: self.instruction.edition, + } + } +} + +struct SetTokenStandardCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/sign_metadata.rs b/clients/rust/src/generated/instructions/sign_metadata.rs new file mode 100644 index 00000000..be3b4a7c --- /dev/null +++ b/clients/rust/src/generated/instructions/sign_metadata.rs @@ -0,0 +1,177 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct SignMetadata { + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Creator + pub creator: solana_program::pubkey::Pubkey, +} + +impl SignMetadata { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = SignMetadataInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.creator, + true, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct SignMetadataInstructionArgs { + discriminator: u8, +} + +impl SignMetadataInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 7 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct SignMetadataBuilder { + metadata: Option, + creator: Option, +} + +impl SignMetadataBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self { + self.creator = Some(creator); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = SignMetadata { + metadata: self.metadata.expect("metadata is not set"), + creator: self.creator.expect("creator is not set"), + }; + + accounts.instruction() + } +} + +/// `sign_metadata` CPI instruction. +pub struct SignMetadataCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Creator + pub creator: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> SignMetadataCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = SignMetadataInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.creator.key, + true, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(2 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.creator.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `sign_metadata` CPI instruction builder. +pub struct SignMetadataCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> SignMetadataCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(SignMetadataCpiBuilderInstruction { + __program: program, + metadata: None, + creator: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn creator( + &mut self, + creator: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.creator = Some(creator); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> SignMetadataCpi<'a> { + SignMetadataCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + creator: self.instruction.creator.expect("creator is not set"), + } + } +} + +struct SignMetadataCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + creator: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/thaw_delegated_account.rs b/clients/rust/src/generated/instructions/thaw_delegated_account.rs new file mode 100644 index 00000000..4020906c --- /dev/null +++ b/clients/rust/src/generated/instructions/thaw_delegated_account.rs @@ -0,0 +1,271 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct ThawDelegatedAccount { + /// Delegate + pub delegate: solana_program::pubkey::Pubkey, + /// Token account to thaw + pub token_account: solana_program::pubkey::Pubkey, + /// Edition + pub edition: solana_program::pubkey::Pubkey, + /// Token mint + pub mint: solana_program::pubkey::Pubkey, + /// Token Program + pub token_program: solana_program::pubkey::Pubkey, +} + +impl ThawDelegatedAccount { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = ThawDelegatedAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + self.delegate, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.edition, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct ThawDelegatedAccountInstructionArgs { + discriminator: u8, +} + +impl ThawDelegatedAccountInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 27 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct ThawDelegatedAccountBuilder { + delegate: Option, + token_account: Option, + edition: Option, + mint: Option, + token_program: Option, +} + +impl ThawDelegatedAccountBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { + self.delegate = Some(delegate); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = ThawDelegatedAccount { + delegate: self.delegate.expect("delegate is not set"), + token_account: self.token_account.expect("token_account is not set"), + edition: self.edition.expect("edition is not set"), + mint: self.mint.expect("mint is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + }; + + accounts.instruction() + } +} + +/// `thaw_delegated_account` CPI instruction. +pub struct ThawDelegatedAccountCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate + pub delegate: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account to thaw + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition + pub edition: &'a solana_program::account_info::AccountInfo<'a>, + /// Token mint + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> ThawDelegatedAccountCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = ThawDelegatedAccountInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(5); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.delegate.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.edition.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(5 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.delegate.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.edition.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.token_program.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `thaw_delegated_account` CPI instruction builder. +pub struct ThawDelegatedAccountCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> ThawDelegatedAccountCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(ThawDelegatedAccountCpiBuilderInstruction { + __program: program, + delegate: None, + token_account: None, + edition: None, + mint: None, + token_program: None, + }); + Self { instruction } + } + pub fn delegate( + &mut self, + delegate: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate = Some(delegate); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> ThawDelegatedAccountCpi<'a> { + ThawDelegatedAccountCpi { + __program: self.instruction.__program, + + delegate: self.instruction.delegate.expect("delegate is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + edition: self.instruction.edition.expect("edition is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + } + } +} + +struct ThawDelegatedAccountCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + delegate: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs new file mode 100644 index 00000000..480c2a77 --- /dev/null +++ b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs @@ -0,0 +1,571 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct TransferOutOfEscrow { + /// Escrow account + pub escrow: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Wallet paying for the transaction and new account + pub payer: solana_program::pubkey::Pubkey, + /// Mint account for the new attribute + pub attribute_mint: solana_program::pubkey::Pubkey, + /// Token account source for the new attribute + pub attribute_src: solana_program::pubkey::Pubkey, + /// Token account, owned by TM, destination for the new attribute + pub attribute_dst: solana_program::pubkey::Pubkey, + /// Mint account that the escrow is attached + pub escrow_mint: solana_program::pubkey::Pubkey, + /// Token account that holds the token the escrow is attached to + pub escrow_account: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Associated Token program + pub ata_program: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Authority/creator of the escrow account + pub authority: Option, +} + +impl TransferOutOfEscrow { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = TransferOutOfEscrowInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(13); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.escrow, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.attribute_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.attribute_src, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.attribute_dst, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.escrow_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.escrow_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.ata_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authority) = self.authority { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authority, true, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct TransferOutOfEscrowInstructionArgs { + discriminator: u8, + pub amount: u64, +} + +impl TransferOutOfEscrowInstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 40, + amount: 1, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct TransferOutOfEscrowBuilder { + escrow: Option, + metadata: Option, + payer: Option, + attribute_mint: Option, + attribute_src: Option, + attribute_dst: Option, + escrow_mint: Option, + escrow_account: Option, + system_program: Option, + ata_program: Option, + token_program: Option, + sysvar_instructions: Option, + authority: Option, + amount: Option, +} + +impl TransferOutOfEscrowBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn escrow(&mut self, escrow: solana_program::pubkey::Pubkey) -> &mut Self { + self.escrow = Some(escrow); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn attribute_mint(&mut self, attribute_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.attribute_mint = Some(attribute_mint); + self + } + pub fn attribute_src(&mut self, attribute_src: solana_program::pubkey::Pubkey) -> &mut Self { + self.attribute_src = Some(attribute_src); + self + } + pub fn attribute_dst(&mut self, attribute_dst: solana_program::pubkey::Pubkey) -> &mut Self { + self.attribute_dst = Some(attribute_dst); + self + } + pub fn escrow_mint(&mut self, escrow_mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.escrow_mint = Some(escrow_mint); + self + } + pub fn escrow_account(&mut self, escrow_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.escrow_account = Some(escrow_account); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn ata_program(&mut self, ata_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.ata_program = Some(ata_program); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = TransferOutOfEscrow { + escrow: self.escrow.expect("escrow is not set"), + metadata: self.metadata.expect("metadata is not set"), + payer: self.payer.expect("payer is not set"), + attribute_mint: self.attribute_mint.expect("attribute_mint is not set"), + attribute_src: self.attribute_src.expect("attribute_src is not set"), + attribute_dst: self.attribute_dst.expect("attribute_dst is not set"), + escrow_mint: self.escrow_mint.expect("escrow_mint is not set"), + escrow_account: self.escrow_account.expect("escrow_account is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + ata_program: self.ata_program.unwrap_or(solana_program::pubkey!( + "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + )), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authority: self.authority, + }; + + accounts.instruction() + } +} + +/// `transfer_out_of_escrow` CPI instruction. +pub struct TransferOutOfEscrowCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Escrow account + pub escrow: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Wallet paying for the transaction and new account + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account for the new attribute + pub attribute_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account source for the new attribute + pub attribute_src: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account, owned by TM, destination for the new attribute + pub attribute_dst: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account that the escrow is attached + pub escrow_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account that holds the token the escrow is attached to + pub escrow_account: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Associated Token program + pub ata_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Authority/creator of the escrow account + pub authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> TransferOutOfEscrowCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = TransferOutOfEscrowInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(13); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.escrow.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.attribute_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.attribute_src.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.attribute_dst.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.escrow_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.escrow_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.ata_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authority) = self.authority { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authority.key, + true, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(13 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.escrow.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.attribute_mint.clone()); + account_infos.push(self.attribute_src.clone()); + account_infos.push(self.attribute_dst.clone()); + account_infos.push(self.escrow_mint.clone()); + account_infos.push(self.escrow_account.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.ata_program.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authority) = self.authority { + account_infos.push(authority.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `transfer_out_of_escrow` CPI instruction builder. +pub struct TransferOutOfEscrowCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> TransferOutOfEscrowCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(TransferOutOfEscrowCpiBuilderInstruction { + __program: program, + escrow: None, + metadata: None, + payer: None, + attribute_mint: None, + attribute_src: None, + attribute_dst: None, + escrow_mint: None, + escrow_account: None, + system_program: None, + ata_program: None, + token_program: None, + sysvar_instructions: None, + authority: None, + amount: None, + }); + Self { instruction } + } + pub fn escrow( + &mut self, + escrow: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.escrow = Some(escrow); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn attribute_mint( + &mut self, + attribute_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.attribute_mint = Some(attribute_mint); + self + } + pub fn attribute_src( + &mut self, + attribute_src: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.attribute_src = Some(attribute_src); + self + } + pub fn attribute_dst( + &mut self, + attribute_dst: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.attribute_dst = Some(attribute_dst); + self + } + pub fn escrow_mint( + &mut self, + escrow_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.escrow_mint = Some(escrow_mint); + self + } + pub fn escrow_account( + &mut self, + escrow_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.escrow_account = Some(escrow_account); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn ata_program( + &mut self, + ata_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.ata_program = Some(ata_program); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> TransferOutOfEscrowCpi<'a> { + TransferOutOfEscrowCpi { + __program: self.instruction.__program, + + escrow: self.instruction.escrow.expect("escrow is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + attribute_mint: self + .instruction + .attribute_mint + .expect("attribute_mint is not set"), + + attribute_src: self + .instruction + .attribute_src + .expect("attribute_src is not set"), + + attribute_dst: self + .instruction + .attribute_dst + .expect("attribute_dst is not set"), + + escrow_mint: self + .instruction + .escrow_mint + .expect("escrow_mint is not set"), + + escrow_account: self + .instruction + .escrow_account + .expect("escrow_account is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + ata_program: self + .instruction + .ata_program + .expect("ata_program is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authority: self.instruction.authority, + } + } +} + +struct TransferOutOfEscrowCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + escrow: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + attribute_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + attribute_src: Option<&'a solana_program::account_info::AccountInfo<'a>>, + attribute_dst: Option<&'a solana_program::account_info::AccountInfo<'a>>, + escrow_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + escrow_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + ata_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, +} diff --git a/clients/rust/src/generated/instructions/transfer_v1.rs b/clients/rust/src/generated/instructions/transfer_v1.rs new file mode 100644 index 00000000..6c26c6e8 --- /dev/null +++ b/clients/rust/src/generated/instructions/transfer_v1.rs @@ -0,0 +1,762 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct TransferV1 { + /// Token account + pub token: solana_program::pubkey::Pubkey, + /// Token account owner + pub token_owner: solana_program::pubkey::Pubkey, + /// Destination token account + pub destination_token: solana_program::pubkey::Pubkey, + /// Destination token account owner + pub destination_owner: solana_program::pubkey::Pubkey, + /// Mint of token asset + pub mint: solana_program::pubkey::Pubkey, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Edition of token asset + pub edition: Option, + /// Owner token record account + pub token_record: Option, + /// Destination token record account + pub destination_token_record: Option, + /// Transfer authority (token owner or delegate) + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System Program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: solana_program::pubkey::Pubkey, + /// SPL Associated Token Account program + pub spl_ata_program: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl TransferV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = TransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(17); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_owner, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.destination_token, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.destination_owner, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(destination_token_record) = self.destination_token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + destination_token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.spl_ata_program, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct TransferV1InstructionArgs { + discriminator: u8, + transfer_v1_discriminator: u8, + pub amount: u64, + pub authorization_data: Option, +} + +impl TransferV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 49, + transfer_v1_discriminator: 0, + amount: 1, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct TransferV1Builder { + token: Option, + token_owner: Option, + destination_token: Option, + destination_owner: Option, + mint: Option, + metadata: Option, + edition: Option, + token_record: Option, + destination_token_record: Option, + authority: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + spl_ata_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + amount: Option, + authorization_data: Option, +} + +impl TransferV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_owner = Some(token_owner); + self + } + pub fn destination_token( + &mut self, + destination_token: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.destination_token = Some(destination_token); + self + } + pub fn destination_owner( + &mut self, + destination_owner: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.destination_owner = Some(destination_owner); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn destination_token_record( + &mut self, + destination_token_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.destination_token_record = Some(destination_token_record); + self + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn spl_ata_program( + &mut self, + spl_ata_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_ata_program = Some(spl_ata_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = TransferV1 { + token: self.token.expect("token is not set"), + token_owner: self.token_owner.expect("token_owner is not set"), + destination_token: self + .destination_token + .expect("destination_token is not set"), + destination_owner: self + .destination_owner + .expect("destination_owner is not set"), + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + token_record: self.token_record, + destination_token_record: self.destination_token_record, + authority: self.authority.expect("authority is not set"), + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + spl_ata_program: self.spl_ata_program.unwrap_or(solana_program::pubkey!( + "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `transfer_v1` CPI instruction. +pub struct TransferV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account owner + pub token_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Destination token account + pub destination_token: &'a solana_program::account_info::AccountInfo<'a>, + /// Destination token account owner + pub destination_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of token asset + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition of token asset + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Destination token record account + pub destination_token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Transfer authority (token owner or delegate) + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System Program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Associated Token Account program + pub spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> TransferV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = TransferV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(17); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_owner.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.destination_token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.destination_owner.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + if let Some(destination_token_record) = self.destination_token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *destination_token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.spl_ata_program.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(17 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.token.clone()); + account_infos.push(self.token_owner.clone()); + account_infos.push(self.destination_token.clone()); + account_infos.push(self.destination_owner.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + if let Some(destination_token_record) = self.destination_token_record { + account_infos.push(destination_token_record.clone()); + } + account_infos.push(self.authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + account_infos.push(self.spl_token_program.clone()); + account_infos.push(self.spl_ata_program.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `transfer_v1` CPI instruction builder. +pub struct TransferV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> TransferV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(TransferV1CpiBuilderInstruction { + __program: program, + token: None, + token_owner: None, + destination_token: None, + destination_owner: None, + mint: None, + metadata: None, + edition: None, + token_record: None, + destination_token_record: None, + authority: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + spl_ata_program: None, + authorization_rules_program: None, + authorization_rules: None, + amount: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn token_owner( + &mut self, + token_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_owner = Some(token_owner); + self + } + pub fn destination_token( + &mut self, + destination_token: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.destination_token = Some(destination_token); + self + } + pub fn destination_owner( + &mut self, + destination_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.destination_owner = Some(destination_owner); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn destination_token_record( + &mut self, + destination_token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.destination_token_record = Some(destination_token_record); + self + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn spl_ata_program( + &mut self, + spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_ata_program = Some(spl_ata_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn amount(&mut self, amount: u64) -> &mut Self { + self.instruction.amount = Some(amount); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> TransferV1Cpi<'a> { + TransferV1Cpi { + __program: self.instruction.__program, + + token: self.instruction.token.expect("token is not set"), + + token_owner: self + .instruction + .token_owner + .expect("token_owner is not set"), + + destination_token: self + .instruction + .destination_token + .expect("destination_token is not set"), + + destination_owner: self + .instruction + .destination_owner + .expect("destination_owner is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + token_record: self.instruction.token_record, + + destination_token_record: self.instruction.destination_token_record, + + authority: self.instruction.authority.expect("authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self + .instruction + .spl_token_program + .expect("spl_token_program is not set"), + + spl_ata_program: self + .instruction + .spl_ata_program + .expect("spl_ata_program is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct TransferV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + destination_token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + destination_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + destination_token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_ata_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + amount: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/unlock_v1.rs b/clients/rust/src/generated/instructions/unlock_v1.rs new file mode 100644 index 00000000..86e1d34e --- /dev/null +++ b/clients/rust/src/generated/instructions/unlock_v1.rs @@ -0,0 +1,605 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UnlockV1 { + /// Delegate or freeze authority + pub authority: solana_program::pubkey::Pubkey, + /// Token owner account + pub token_owner: Option, + /// Token account + pub token: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Token record account + pub token_record: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// System program + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UnlockV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UnlockV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(13); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(token_owner) = self.token_owner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token_owner, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + token_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UnlockV1InstructionArgs { + discriminator: u8, + unlock_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl UnlockV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 47, + unlock_v1_discriminator: 0, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UnlockV1Builder { + authority: Option, + token_owner: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + token_record: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl UnlockV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_owner = Some(token_owner); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_record = Some(token_record); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UnlockV1 { + authority: self.authority.expect("authority is not set"), + token_owner: self.token_owner, + token: self.token.expect("token is not set"), + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + token_record: self.token_record, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `unlock_v1` CPI instruction. +pub struct UnlockV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate or freeze authority + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Token owner account + pub token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UnlockV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UnlockV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(13); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(token_owner) = self.token_owner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token_owner.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } + if let Some(token_record) = self.token_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *token_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(13 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(token_owner) = self.token_owner { + account_infos.push(token_owner.clone()); + } + account_infos.push(self.token.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + if let Some(token_record) = self.token_record { + account_infos.push(token_record.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `unlock_v1` CPI instruction builder. +pub struct UnlockV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UnlockV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UnlockV1CpiBuilderInstruction { + __program: program, + authority: None, + token_owner: None, + token: None, + mint: None, + metadata: None, + edition: None, + token_record: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn token_owner( + &mut self, + token_owner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_owner = Some(token_owner); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn token_record( + &mut self, + token_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_record = Some(token_record); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UnlockV1Cpi<'a> { + UnlockV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + token_owner: self.instruction.token_owner, + + token: self.instruction.token.expect("token is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + token_record: self.instruction.token_record, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UnlockV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/unverify_collection.rs b/clients/rust/src/generated/instructions/unverify_collection.rs new file mode 100644 index 00000000..d3c444da --- /dev/null +++ b/clients/rust/src/generated/instructions/unverify_collection.rs @@ -0,0 +1,339 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UnverifyCollection { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Collection Authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection: solana_program::pubkey::Pubkey, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl UnverifyCollection { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UnverifyCollectionInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(6); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_master_edition_account, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UnverifyCollectionInstructionArgs { + discriminator: u8, +} + +impl UnverifyCollectionInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 22 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UnverifyCollectionBuilder { + metadata: Option, + collection_authority: Option, + collection_mint: Option, + collection: Option, + collection_master_edition_account: Option, + collection_authority_record: Option, +} + +impl UnverifyCollectionBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition_account = Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UnverifyCollection { + metadata: self.metadata.expect("metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection: self.collection.expect("collection is not set"), + collection_master_edition_account: self + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + collection_authority_record: self.collection_authority_record, + }; + + accounts.instruction() + } +} + +/// `unverify_collection` CPI instruction. +pub struct UnverifyCollectionCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UnverifyCollectionCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UnverifyCollectionInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(6); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_master_edition_account.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(6 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.collection.clone()); + account_infos.push(self.collection_master_edition_account.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `unverify_collection` CPI instruction builder. +pub struct UnverifyCollectionCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UnverifyCollectionCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UnverifyCollectionCpiBuilderInstruction { + __program: program, + metadata: None, + collection_authority: None, + collection_mint: None, + collection: None, + collection_master_edition_account: None, + collection_authority_record: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection( + &mut self, + collection: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition_account = + Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UnverifyCollectionCpi<'a> { + UnverifyCollectionCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection: self.instruction.collection.expect("collection is not set"), + + collection_master_edition_account: self + .instruction + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + } + } +} + +struct UnverifyCollectionCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/unverify_collection_v1.rs b/clients/rust/src/generated/instructions/unverify_collection_v1.rs new file mode 100644 index 00000000..1b9ef1ab --- /dev/null +++ b/clients/rust/src/generated/instructions/unverify_collection_v1.rs @@ -0,0 +1,383 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UnverifyCollectionV1 { + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection_metadata: Option, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, +} + +impl UnverifyCollectionV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UnverifyCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + collection_metadata, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UnverifyCollectionV1InstructionArgs { + discriminator: u8, + unverify_collection_v1_discriminator: u8, +} + +impl UnverifyCollectionV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 53, + unverify_collection_v1_discriminator: 1, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UnverifyCollectionV1Builder { + authority: Option, + delegate_record: Option, + metadata: Option, + collection_mint: Option, + collection_metadata: Option, + system_program: Option, + sysvar_instructions: Option, +} + +impl UnverifyCollectionV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UnverifyCollectionV1 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + metadata: self.metadata.expect("metadata is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection_metadata: self.collection_metadata, + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + }; + + accounts.instruction() + } +} + +/// `unverify_collection_v1` CPI instruction. +pub struct UnverifyCollectionV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> UnverifyCollectionV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UnverifyCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + *collection_metadata.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_mint.clone()); + if let Some(collection_metadata) = self.collection_metadata { + account_infos.push(collection_metadata.clone()); + } + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `unverify_collection_v1` CPI instruction builder. +pub struct UnverifyCollectionV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UnverifyCollectionV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UnverifyCollectionV1CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + metadata: None, + collection_mint: None, + collection_metadata: None, + system_program: None, + sysvar_instructions: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UnverifyCollectionV1Cpi<'a> { + UnverifyCollectionV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection_metadata: self.instruction.collection_metadata, + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + } + } +} + +struct UnverifyCollectionV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/unverify_creator_v1.rs b/clients/rust/src/generated/instructions/unverify_creator_v1.rs new file mode 100644 index 00000000..587941f1 --- /dev/null +++ b/clients/rust/src/generated/instructions/unverify_creator_v1.rs @@ -0,0 +1,401 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UnverifyCreatorV1 { + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: Option, + /// Metadata Account of the Collection + pub collection_metadata: Option, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, +} + +impl UnverifyCreatorV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UnverifyCreatorV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(collection_mint) = self.collection_mint { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_mint, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + collection_metadata, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UnverifyCreatorV1InstructionArgs { + discriminator: u8, + unverify_creator_v1_discriminator: u8, +} + +impl UnverifyCreatorV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 53, + unverify_creator_v1_discriminator: 0, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UnverifyCreatorV1Builder { + authority: Option, + delegate_record: Option, + metadata: Option, + collection_mint: Option, + collection_metadata: Option, + system_program: Option, + sysvar_instructions: Option, +} + +impl UnverifyCreatorV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UnverifyCreatorV1 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + metadata: self.metadata.expect("metadata is not set"), + collection_mint: self.collection_mint, + collection_metadata: self.collection_metadata, + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + }; + + accounts.instruction() + } +} + +/// `unverify_creator_v1` CPI instruction. +pub struct UnverifyCreatorV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata Account of the Collection + pub collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> UnverifyCreatorV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UnverifyCreatorV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(collection_mint) = self.collection_mint { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_mint.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + *collection_metadata.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.metadata.clone()); + if let Some(collection_mint) = self.collection_mint { + account_infos.push(collection_mint.clone()); + } + if let Some(collection_metadata) = self.collection_metadata { + account_infos.push(collection_metadata.clone()); + } + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `unverify_creator_v1` CPI instruction builder. +pub struct UnverifyCreatorV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UnverifyCreatorV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UnverifyCreatorV1CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + metadata: None, + collection_mint: None, + collection_metadata: None, + system_program: None, + sysvar_instructions: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UnverifyCreatorV1Cpi<'a> { + UnverifyCreatorV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_mint: self.instruction.collection_mint, + + collection_metadata: self.instruction.collection_metadata, + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + } + } +} + +struct UnverifyCreatorV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs new file mode 100644 index 00000000..f58241f0 --- /dev/null +++ b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs @@ -0,0 +1,365 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UnverifySizedCollectionItem { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Collection Authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection: solana_program::pubkey::Pubkey, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl UnverifySizedCollectionItem { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UnverifySizedCollectionItemInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_master_edition_account, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UnverifySizedCollectionItemInstructionArgs { + discriminator: u8, +} + +impl UnverifySizedCollectionItemInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 31 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UnverifySizedCollectionItemBuilder { + metadata: Option, + collection_authority: Option, + payer: Option, + collection_mint: Option, + collection: Option, + collection_master_edition_account: Option, + collection_authority_record: Option, +} + +impl UnverifySizedCollectionItemBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition_account = Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UnverifySizedCollectionItem { + metadata: self.metadata.expect("metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + payer: self.payer.expect("payer is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection: self.collection.expect("collection is not set"), + collection_master_edition_account: self + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + collection_authority_record: self.collection_authority_record, + }; + + accounts.instruction() + } +} + +/// `unverify_sized_collection_item` CPI instruction. +pub struct UnverifySizedCollectionItemCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UnverifySizedCollectionItemCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UnverifySizedCollectionItemInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_master_edition_account.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.collection.clone()); + account_infos.push(self.collection_master_edition_account.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `unverify_sized_collection_item` CPI instruction builder. +pub struct UnverifySizedCollectionItemCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UnverifySizedCollectionItemCpiBuilderInstruction { + __program: program, + metadata: None, + collection_authority: None, + payer: None, + collection_mint: None, + collection: None, + collection_master_edition_account: None, + collection_authority_record: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection( + &mut self, + collection: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition_account = + Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UnverifySizedCollectionItemCpi<'a> { + UnverifySizedCollectionItemCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection: self.instruction.collection.expect("collection is not set"), + + collection_master_edition_account: self + .instruction + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + } + } +} + +struct UnverifySizedCollectionItemCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs new file mode 100644 index 00000000..6d4f0f53 --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs @@ -0,0 +1,597 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::TokenStandard; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +/// Accounts. +pub struct UpdateAsAuthorityItemDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsAuthorityItemDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsAuthorityItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsAuthorityItemDelegateV2InstructionArgs { + discriminator: u8, + update_as_authority_item_delegate_v2_discriminator: u8, + pub new_update_authority: Option, + pub primary_sale_happened: Option, + pub is_mutable: Option, + pub token_standard: Option, + pub authorization_data: Option, +} + +impl UpdateAsAuthorityItemDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_authority_item_delegate_v2_discriminator: 2, + new_update_authority: None, + primary_sale_happened: None, + is_mutable: None, + token_standard: None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsAuthorityItemDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + new_update_authority: Option, + primary_sale_happened: Option, + is_mutable: Option, + token_standard: Option, + authorization_data: Option, +} + +impl UpdateAsAuthorityItemDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.new_update_authority = Some(new_update_authority); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.is_mutable = Some(is_mutable); + self + } + pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { + self.token_standard = Some(token_standard); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsAuthorityItemDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_authority_item_delegate_v2` CPI instruction. +pub struct UpdateAsAuthorityItemDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsAuthorityItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_authority_item_delegate_v2` CPI instruction builder. +pub struct UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsAuthorityItemDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + new_update_authority: None, + primary_sale_happened: None, + is_mutable: None, + token_standard: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.instruction.new_update_authority = Some(new_update_authority); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.instruction.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.instruction.is_mutable = Some(is_mutable); + self + } + pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { + self.instruction.token_standard = Some(token_standard); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsAuthorityItemDelegateV2Cpi<'a> { + UpdateAsAuthorityItemDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsAuthorityItemDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_update_authority: Option, + primary_sale_happened: Option, + is_mutable: Option, + token_standard: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs new file mode 100644 index 00000000..ff256ed9 --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs @@ -0,0 +1,557 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::CollectionToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdateAsCollectionDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsCollectionDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsCollectionDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsCollectionDelegateV2InstructionArgs { + discriminator: u8, + update_as_collection_delegate_v2_discriminator: u8, + pub collection: CollectionToggle, + pub authorization_data: Option, +} + +impl UpdateAsCollectionDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_collection_delegate_v2_discriminator: 3, + collection: CollectionToggle::None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsCollectionDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + collection: Option, + authorization_data: Option, +} + +impl UpdateAsCollectionDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsCollectionDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_collection_delegate_v2` CPI instruction. +pub struct UpdateAsCollectionDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsCollectionDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_collection_delegate_v2` CPI instruction builder. +pub struct UpdateAsCollectionDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsCollectionDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + collection: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsCollectionDelegateV2Cpi<'a> { + UpdateAsCollectionDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsCollectionDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs new file mode 100644 index 00000000..3860b7f9 --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs @@ -0,0 +1,557 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::CollectionToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdateAsCollectionItemDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsCollectionItemDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsCollectionItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsCollectionItemDelegateV2InstructionArgs { + discriminator: u8, + update_as_collection_item_delegate_v2_discriminator: u8, + pub collection: CollectionToggle, + pub authorization_data: Option, +} + +impl UpdateAsCollectionItemDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_collection_item_delegate_v2_discriminator: 7, + collection: CollectionToggle::None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsCollectionItemDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + collection: Option, + authorization_data: Option, +} + +impl UpdateAsCollectionItemDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsCollectionItemDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_collection_item_delegate_v2` CPI instruction. +pub struct UpdateAsCollectionItemDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsCollectionItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_collection_item_delegate_v2` CPI instruction builder. +pub struct UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsCollectionItemDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + collection: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsCollectionItemDelegateV2Cpi<'a> { + UpdateAsCollectionItemDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsCollectionItemDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs new file mode 100644 index 00000000..64ebd1ae --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs @@ -0,0 +1,566 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::Creator; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdateAsDataDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsDataDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsDataDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsDataDelegateV2InstructionArgs { + discriminator: u8, + update_as_data_delegate_v2_discriminator: u8, + pub data: Option, + pub authorization_data: Option, +} + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateAsDataDelegateV2InstructionDataData { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} + +impl UpdateAsDataDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_data_delegate_v2_discriminator: 4, + data: None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsDataDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + data: Option, + authorization_data: Option, +} + +impl UpdateAsDataDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn data(&mut self, data: UpdateAsDataDelegateV2InstructionDataData) -> &mut Self { + self.data = Some(data); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsDataDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_data_delegate_v2` CPI instruction. +pub struct UpdateAsDataDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsDataDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsDataDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_data_delegate_v2` CPI instruction builder. +pub struct UpdateAsDataDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsDataDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + data: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn data(&mut self, data: UpdateAsDataDelegateV2InstructionDataData) -> &mut Self { + self.instruction.data = Some(data); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsDataDelegateV2Cpi<'a> { + UpdateAsDataDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsDataDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + data: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs new file mode 100644 index 00000000..bf728bac --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs @@ -0,0 +1,566 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::Creator; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdateAsDataItemDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsDataItemDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsDataItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsDataItemDelegateV2InstructionArgs { + discriminator: u8, + update_as_data_item_delegate_v2_discriminator: u8, + pub data: Option, + pub authorization_data: Option, +} + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateAsDataItemDelegateV2InstructionDataData { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} + +impl UpdateAsDataItemDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_data_item_delegate_v2_discriminator: 6, + data: None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsDataItemDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + data: Option, + authorization_data: Option, +} + +impl UpdateAsDataItemDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn data(&mut self, data: UpdateAsDataItemDelegateV2InstructionDataData) -> &mut Self { + self.data = Some(data); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsDataItemDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_data_item_delegate_v2` CPI instruction. +pub struct UpdateAsDataItemDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsDataItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_data_item_delegate_v2` CPI instruction builder. +pub struct UpdateAsDataItemDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsDataItemDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + data: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn data(&mut self, data: UpdateAsDataItemDelegateV2InstructionDataData) -> &mut Self { + self.instruction.data = Some(data); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsDataItemDelegateV2Cpi<'a> { + UpdateAsDataItemDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsDataItemDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + data: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs new file mode 100644 index 00000000..b6ddc132 --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs @@ -0,0 +1,542 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::RuleSetToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdateAsProgrammableConfigDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsProgrammableConfigDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsProgrammableConfigDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsProgrammableConfigDelegateV2InstructionArgs { + discriminator: u8, + update_as_programmable_config_delegate_v2_discriminator: u8, + pub rule_set: RuleSetToggle, + pub authorization_data: Option, +} + +impl UpdateAsProgrammableConfigDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_programmable_config_delegate_v2_discriminator: 5, + rule_set: RuleSetToggle::None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsProgrammableConfigDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + rule_set: Option, + authorization_data: Option, +} + +impl UpdateAsProgrammableConfigDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.rule_set = Some(rule_set); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsProgrammableConfigDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token.expect("token is not set"), + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_programmable_config_delegate_v2` CPI instruction. +pub struct UpdateAsProgrammableConfigDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsProgrammableConfigDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.token.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_programmable_config_delegate_v2` CPI instruction builder. +pub struct UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsProgrammableConfigDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + rule_set: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.instruction.rule_set = Some(rule_set); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { + UpdateAsProgrammableConfigDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token.expect("token is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsProgrammableConfigDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rule_set: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs new file mode 100644 index 00000000..0c088aa1 --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs @@ -0,0 +1,544 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::RuleSetToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdateAsProgrammableConfigItemDelegateV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: solana_program::pubkey::Pubkey, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsProgrammableConfigItemDelegateV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsProgrammableConfigItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { + discriminator: u8, + update_as_programmable_config_item_delegate_v2_discriminator: u8, + pub rule_set: RuleSetToggle, + pub authorization_data: Option, +} + +impl UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_programmable_config_item_delegate_v2_discriminator: 8, + rule_set: RuleSetToggle::None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsProgrammableConfigItemDelegateV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + rule_set: Option, + authorization_data: Option, +} + +impl UpdateAsProgrammableConfigItemDelegateV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.rule_set = Some(rule_set); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsProgrammableConfigItemDelegateV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token.expect("token is not set"), + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_programmable_config_item_delegate_v2` CPI instruction. +pub struct UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsProgrammableConfigItemDelegateV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.token.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_programmable_config_item_delegate_v2` CPI instruction builder. +pub struct UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new( + UpdateAsProgrammableConfigItemDelegateV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + rule_set: None, + authorization_data: None, + }, + ); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.instruction.rule_set = Some(rule_set); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { + UpdateAsProgrammableConfigItemDelegateV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token.expect("token is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsProgrammableConfigItemDelegateV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rule_set: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs new file mode 100644 index 00000000..cacd4b1d --- /dev/null +++ b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs @@ -0,0 +1,681 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::CollectionDetailsToggle; +use crate::generated::types::CollectionToggle; +use crate::generated::types::Creator; +use crate::generated::types::RuleSetToggle; +use crate::generated::types::TokenStandard; +use crate::generated::types::UsesToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +/// Accounts. +pub struct UpdateAsUpdateAuthorityV2 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateAsUpdateAuthorityV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateAsUpdateAuthorityV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateAsUpdateAuthorityV2InstructionArgs { + discriminator: u8, + update_as_update_authority_v2_discriminator: u8, + pub new_update_authority: Option, + pub data: Option, + pub primary_sale_happened: Option, + pub is_mutable: Option, + pub collection: CollectionToggle, + pub collection_details: CollectionDetailsToggle, + pub uses: UsesToggle, + pub rule_set: RuleSetToggle, + pub token_standard: Option, + pub authorization_data: Option, +} + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateAsUpdateAuthorityV2InstructionDataData { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} + +impl UpdateAsUpdateAuthorityV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_as_update_authority_v2_discriminator: 1, + new_update_authority: None, + data: None, + primary_sale_happened: None, + is_mutable: None, + collection: CollectionToggle::None, + collection_details: CollectionDetailsToggle::None, + uses: UsesToggle::None, + rule_set: RuleSetToggle::None, + token_standard: None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateAsUpdateAuthorityV2Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + new_update_authority: Option, + data: Option, + primary_sale_happened: Option, + is_mutable: Option, + collection: Option, + collection_details: Option, + uses: Option, + rule_set: Option, + token_standard: Option, + authorization_data: Option, +} + +impl UpdateAsUpdateAuthorityV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.new_update_authority = Some(new_update_authority); + self + } + pub fn data(&mut self, data: UpdateAsUpdateAuthorityV2InstructionDataData) -> &mut Self { + self.data = Some(data); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.is_mutable = Some(is_mutable); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { + self.collection_details = Some(collection_details); + self + } + pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { + self.uses = Some(uses); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.rule_set = Some(rule_set); + self + } + pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { + self.token_standard = Some(token_standard); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateAsUpdateAuthorityV2 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_as_update_authority_v2` CPI instruction. +pub struct UpdateAsUpdateAuthorityV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateAsUpdateAuthorityV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_as_update_authority_v2` CPI instruction builder. +pub struct UpdateAsUpdateAuthorityV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateAsUpdateAuthorityV2CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + new_update_authority: None, + data: None, + primary_sale_happened: None, + is_mutable: None, + collection: None, + collection_details: None, + uses: None, + rule_set: None, + token_standard: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.instruction.new_update_authority = Some(new_update_authority); + self + } + pub fn data(&mut self, data: UpdateAsUpdateAuthorityV2InstructionDataData) -> &mut Self { + self.instruction.data = Some(data); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.instruction.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.instruction.is_mutable = Some(is_mutable); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { + self.instruction.collection_details = Some(collection_details); + self + } + pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { + self.instruction.uses = Some(uses); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.instruction.rule_set = Some(rule_set); + self + } + pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { + self.instruction.token_standard = Some(token_standard); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateAsUpdateAuthorityV2Cpi<'a> { + UpdateAsUpdateAuthorityV2Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateAsUpdateAuthorityV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_update_authority: Option, + data: Option, + primary_sale_happened: Option, + is_mutable: Option, + collection: Option, + collection_details: Option, + uses: Option, + rule_set: Option, + token_standard: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs new file mode 100644 index 00000000..e7073b1c --- /dev/null +++ b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs @@ -0,0 +1,239 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::DataV2; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +/// Accounts. +pub struct UpdateMetadataAccountV2 { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Update authority key + pub update_authority: solana_program::pubkey::Pubkey, +} + +impl UpdateMetadataAccountV2 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateMetadataAccountV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.update_authority, + true, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateMetadataAccountV2InstructionArgs { + discriminator: u8, + pub data: Option, + pub new_update_authority: Option, + pub primary_sale_happened: Option, + pub is_mutable: Option, +} + +impl UpdateMetadataAccountV2InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 15, + data: None, + new_update_authority: None, + primary_sale_happened: None, + is_mutable: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateMetadataAccountV2Builder { + metadata: Option, + update_authority: Option, + data: Option, + new_update_authority: Option, + primary_sale_happened: Option, + is_mutable: Option, +} + +impl UpdateMetadataAccountV2Builder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn update_authority( + &mut self, + update_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.update_authority = Some(update_authority); + self + } + pub fn data(&mut self, data: DataV2) -> &mut Self { + self.data = Some(data); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.new_update_authority = Some(new_update_authority); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.is_mutable = Some(is_mutable); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateMetadataAccountV2 { + metadata: self.metadata.expect("metadata is not set"), + update_authority: self.update_authority.expect("update_authority is not set"), + }; + + accounts.instruction() + } +} + +/// `update_metadata_account_v2` CPI instruction. +pub struct UpdateMetadataAccountV2Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority key + pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> UpdateMetadataAccountV2Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateMetadataAccountV2InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(2); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.update_authority.key, + true, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(2 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.update_authority.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_metadata_account_v2` CPI instruction builder. +pub struct UpdateMetadataAccountV2CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateMetadataAccountV2CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateMetadataAccountV2CpiBuilderInstruction { + __program: program, + metadata: None, + update_authority: None, + data: None, + new_update_authority: None, + primary_sale_happened: None, + is_mutable: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn update_authority( + &mut self, + update_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.update_authority = Some(update_authority); + self + } + pub fn data(&mut self, data: DataV2) -> &mut Self { + self.instruction.data = Some(data); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.instruction.new_update_authority = Some(new_update_authority); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.instruction.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.instruction.is_mutable = Some(is_mutable); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateMetadataAccountV2Cpi<'a> { + UpdateMetadataAccountV2Cpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + update_authority: self + .instruction + .update_authority + .expect("update_authority is not set"), + } + } +} + +struct UpdateMetadataAccountV2CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + update_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + data: Option, + new_update_authority: Option, + primary_sale_happened: Option, + is_mutable: Option, +} diff --git a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs new file mode 100644 index 00000000..a3763924 --- /dev/null +++ b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs @@ -0,0 +1,199 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UpdatePrimarySaleHappenedViaToken { + /// Metadata key (pda of ['metadata', program id, mint id]) + pub metadata: solana_program::pubkey::Pubkey, + /// Owner on the token account + pub owner: solana_program::pubkey::Pubkey, + /// Account containing tokens from the metadata's mint + pub token: solana_program::pubkey::Pubkey, +} + +impl UpdatePrimarySaleHappenedViaToken { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdatePrimarySaleHappenedViaTokenInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(3); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.owner, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token, false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdatePrimarySaleHappenedViaTokenInstructionArgs { + discriminator: u8, +} + +impl UpdatePrimarySaleHappenedViaTokenInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 4 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdatePrimarySaleHappenedViaTokenBuilder { + metadata: Option, + owner: Option, + token: Option, +} + +impl UpdatePrimarySaleHappenedViaTokenBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.owner = Some(owner); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdatePrimarySaleHappenedViaToken { + metadata: self.metadata.expect("metadata is not set"), + owner: self.owner.expect("owner is not set"), + token: self.token.expect("token is not set"), + }; + + accounts.instruction() + } +} + +/// `update_primary_sale_happened_via_token` CPI instruction. +pub struct UpdatePrimarySaleHappenedViaTokenCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata key (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Owner on the token account + pub owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Account containing tokens from the metadata's mint + pub token: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> UpdatePrimarySaleHappenedViaTokenCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdatePrimarySaleHappenedViaTokenInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(3); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.owner.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(3 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.owner.clone()); + account_infos.push(self.token.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_primary_sale_happened_via_token` CPI instruction builder. +pub struct UpdatePrimarySaleHappenedViaTokenCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdatePrimarySaleHappenedViaTokenCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdatePrimarySaleHappenedViaTokenCpiBuilderInstruction { + __program: program, + metadata: None, + owner: None, + token: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.owner = Some(owner); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdatePrimarySaleHappenedViaTokenCpi<'a> { + UpdatePrimarySaleHappenedViaTokenCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + owner: self.instruction.owner.expect("owner is not set"), + + token: self.instruction.token.expect("token is not set"), + } + } +} + +struct UpdatePrimarySaleHappenedViaTokenCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/update_v1.rs b/clients/rust/src/generated/instructions/update_v1.rs new file mode 100644 index 00000000..67b8c2cf --- /dev/null +++ b/clients/rust/src/generated/instructions/update_v1.rs @@ -0,0 +1,667 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::CollectionDetailsToggle; +use crate::generated::types::CollectionToggle; +use crate::generated::types::Creator; +use crate::generated::types::RuleSetToggle; +use crate::generated::types::UsesToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +/// Accounts. +pub struct UpdateV1 { + /// Update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UpdateV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UpdateV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + token, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UpdateV1InstructionArgs { + discriminator: u8, + update_v1_discriminator: u8, + pub new_update_authority: Option, + pub data: Option, + pub primary_sale_happened: Option, + pub is_mutable: Option, + pub collection: CollectionToggle, + pub collection_details: CollectionDetailsToggle, + pub uses: UsesToggle, + pub rule_set: RuleSetToggle, + pub authorization_data: Option, +} + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateV1InstructionDataData { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} + +impl UpdateV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 50, + update_v1_discriminator: 0, + new_update_authority: None, + data: None, + primary_sale_happened: None, + is_mutable: None, + collection: CollectionToggle::None, + collection_details: CollectionDetailsToggle::None, + uses: UsesToggle::None, + rule_set: RuleSetToggle::None, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UpdateV1Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + authorization_rules_program: Option, + authorization_rules: Option, + new_update_authority: Option, + data: Option, + primary_sale_happened: Option, + is_mutable: Option, + collection: Option, + collection_details: Option, + uses: Option, + rule_set: Option, + authorization_data: Option, +} + +impl UpdateV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.new_update_authority = Some(new_update_authority); + self + } + pub fn data(&mut self, data: UpdateV1InstructionDataData) -> &mut Self { + self.data = Some(data); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.is_mutable = Some(is_mutable); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { + self.collection_details = Some(collection_details); + self + } + pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { + self.uses = Some(uses); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.rule_set = Some(rule_set); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UpdateV1 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `update_v1` CPI instruction. +pub struct UpdateV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UpdateV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UpdateV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `update_v1` CPI instruction builder. +pub struct UpdateV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UpdateV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UpdateV1CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + authorization_rules_program: None, + authorization_rules: None, + new_update_authority: None, + data: None, + primary_sale_happened: None, + is_mutable: None, + collection: None, + collection_details: None, + uses: None, + rule_set: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { + self.instruction.new_update_authority = Some(new_update_authority); + self + } + pub fn data(&mut self, data: UpdateV1InstructionDataData) -> &mut Self { + self.instruction.data = Some(data); + self + } + pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { + self.instruction.primary_sale_happened = Some(primary_sale_happened); + self + } + pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { + self.instruction.is_mutable = Some(is_mutable); + self + } + pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { + self.instruction.collection_details = Some(collection_details); + self + } + pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { + self.instruction.uses = Some(uses); + self + } + pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { + self.instruction.rule_set = Some(rule_set); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UpdateV1Cpi<'a> { + UpdateV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UpdateV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + new_update_authority: Option, + data: Option, + primary_sale_happened: Option, + is_mutable: Option, + collection: Option, + collection_details: Option, + uses: Option, + rule_set: Option, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/use_v1.rs b/clients/rust/src/generated/instructions/use_v1.rs new file mode 100644 index 00000000..288d14c2 --- /dev/null +++ b/clients/rust/src/generated/instructions/use_v1.rs @@ -0,0 +1,595 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct UseV1 { + /// Token owner or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Token account + pub token: Option, + /// Mint account + pub mint: solana_program::pubkey::Pubkey, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Edition account + pub edition: Option, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// System program + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token Program + pub spl_token_program: Option, + /// Token Authorization Rules Program + pub authorization_rules_program: Option, + /// Token Authorization Rules account + pub authorization_rules: Option, +} + +impl UseV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = UseV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(12); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new(token, false)); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new( + edition, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + spl_token_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + authorization_rules, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct UseV1InstructionArgs { + discriminator: u8, + use_v1_discriminator: u8, + pub authorization_data: Option, +} + +impl UseV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 51, + use_v1_discriminator: 0, + authorization_data: None, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UseV1Builder { + authority: Option, + delegate_record: Option, + token: Option, + mint: Option, + metadata: Option, + edition: Option, + payer: Option, + system_program: Option, + sysvar_instructions: Option, + spl_token_program: Option, + authorization_rules_program: Option, + authorization_rules: Option, + authorization_data: Option, +} + +impl UseV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { + self.token = Some(token); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { + self.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = UseV1 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + token: self.token, + mint: self.mint.expect("mint is not set"), + metadata: self.metadata.expect("metadata is not set"), + edition: self.edition, + payer: self.payer.expect("payer is not set"), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + spl_token_program: self.spl_token_program, + authorization_rules_program: self.authorization_rules_program, + authorization_rules: self.authorization_rules, + }; + + accounts.instruction() + } +} + +/// `use_v1` CPI instruction. +pub struct UseV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token owner or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint account + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition account + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token Program + pub spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> UseV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = UseV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(12); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(token) = self.token { + accounts.push(solana_program::instruction::AccountMeta::new( + *token.key, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(edition) = self.edition { + accounts.push(solana_program::instruction::AccountMeta::new( + *edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + if let Some(spl_token_program) = self.spl_token_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *spl_token_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules_program.key, + false, + )); + } + if let Some(authorization_rules) = self.authorization_rules { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *authorization_rules.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(12 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + if let Some(token) = self.token { + account_infos.push(token.clone()); + } + account_infos.push(self.mint.clone()); + account_infos.push(self.metadata.clone()); + if let Some(edition) = self.edition { + account_infos.push(edition.clone()); + } + account_infos.push(self.payer.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + if let Some(spl_token_program) = self.spl_token_program { + account_infos.push(spl_token_program.clone()); + } + if let Some(authorization_rules_program) = self.authorization_rules_program { + account_infos.push(authorization_rules_program.clone()); + } + if let Some(authorization_rules) = self.authorization_rules { + account_infos.push(authorization_rules.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `use_v1` CPI instruction builder. +pub struct UseV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UseV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UseV1CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + token: None, + mint: None, + metadata: None, + edition: None, + payer: None, + system_program: None, + sysvar_instructions: None, + spl_token_program: None, + authorization_rules_program: None, + authorization_rules: None, + authorization_data: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.token = Some(token); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn edition( + &mut self, + edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.edition = Some(edition); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + pub fn spl_token_program( + &mut self, + spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.spl_token_program = Some(spl_token_program); + self + } + pub fn authorization_rules_program( + &mut self, + authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules_program = Some(authorization_rules_program); + self + } + pub fn authorization_rules( + &mut self, + authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authorization_rules = Some(authorization_rules); + self + } + pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { + self.instruction.authorization_data = Some(authorization_data); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UseV1Cpi<'a> { + UseV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + token: self.instruction.token, + + mint: self.instruction.mint.expect("mint is not set"), + + metadata: self.instruction.metadata.expect("metadata is not set"), + + edition: self.instruction.edition, + + payer: self.instruction.payer.expect("payer is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + + spl_token_program: self.instruction.spl_token_program, + + authorization_rules_program: self.instruction.authorization_rules_program, + + authorization_rules: self.instruction.authorization_rules, + } + } +} + +struct UseV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, + spl_token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + authorization_data: Option, +} diff --git a/clients/rust/src/generated/instructions/utilize.rs b/clients/rust/src/generated/instructions/utilize.rs new file mode 100644 index 00000000..eb347f18 --- /dev/null +++ b/clients/rust/src/generated/instructions/utilize.rs @@ -0,0 +1,521 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct Utilize { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Token Account Of NFT + pub token_account: solana_program::pubkey::Pubkey, + /// Mint of the Metadata + pub mint: solana_program::pubkey::Pubkey, + /// A Use Authority / Can be the current Owner of the NFT + pub use_authority: solana_program::pubkey::Pubkey, + /// Owner + pub owner: solana_program::pubkey::Pubkey, + /// Token program + pub token_program: solana_program::pubkey::Pubkey, + /// Associated Token program + pub ata_program: solana_program::pubkey::Pubkey, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Rent info + pub rent: solana_program::pubkey::Pubkey, + /// Use Authority Record PDA If present the program Assumes a delegated use authority + pub use_authority_record: Option, + /// Program As Signer (Burner) + pub burner: Option, +} + +impl Utilize { + #[allow(clippy::vec_init_then_push)] + pub fn instruction( + &self, + args: UtilizeInstructionArgs, + ) -> solana_program::instruction::Instruction { + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.token_account, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.mint, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.use_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.owner, false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.token_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.ata_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.rent, false, + )); + if let Some(use_authority_record) = self.use_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new( + use_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(burner) = self.burner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + burner, false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UtilizeInstructionArgs { + discriminator: u8, + pub number_of_uses: u64, +} + +impl UtilizeInstructionArgs { + pub fn new(number_of_uses: u64) -> Self { + Self { + discriminator: 19, + number_of_uses, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct UtilizeBuilder { + metadata: Option, + token_account: Option, + mint: Option, + use_authority: Option, + owner: Option, + token_program: Option, + ata_program: Option, + system_program: Option, + rent: Option, + use_authority_record: Option, + burner: Option, + number_of_uses: Option, +} + +impl UtilizeBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_account = Some(token_account); + self + } + pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { + self.mint = Some(mint); + self + } + pub fn use_authority(&mut self, use_authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.use_authority = Some(use_authority); + self + } + pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { + self.owner = Some(owner); + self + } + pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.token_program = Some(token_program); + self + } + pub fn ata_program(&mut self, ata_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.ata_program = Some(ata_program); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { + self.rent = Some(rent); + self + } + pub fn use_authority_record( + &mut self, + use_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.use_authority_record = Some(use_authority_record); + self + } + pub fn burner(&mut self, burner: solana_program::pubkey::Pubkey) -> &mut Self { + self.burner = Some(burner); + self + } + pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { + self.number_of_uses = Some(number_of_uses); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = Utilize { + metadata: self.metadata.expect("metadata is not set"), + token_account: self.token_account.expect("token_account is not set"), + mint: self.mint.expect("mint is not set"), + use_authority: self.use_authority.expect("use_authority is not set"), + owner: self.owner.expect("owner is not set"), + token_program: self.token_program.unwrap_or(solana_program::pubkey!( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + )), + ata_program: self.ata_program.unwrap_or(solana_program::pubkey!( + "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + )), + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + rent: self.rent.unwrap_or(solana_program::pubkey!( + "SysvarRent111111111111111111111111111111111" + )), + use_authority_record: self.use_authority_record, + burner: self.burner, + }; + let args = UtilizeInstructionArgs::new( + self.number_of_uses + .clone() + .expect("number_of_uses is not set"), + ); + + accounts.instruction(args) + } +} + +/// `utilize` CPI instruction. +pub struct UtilizeCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Account Of NFT + pub token_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Metadata + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// A Use Authority / Can be the current Owner of the NFT + pub use_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Owner + pub owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Token program + pub token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Associated Token program + pub ata_program: &'a solana_program::account_info::AccountInfo<'a>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Rent info + pub rent: &'a solana_program::account_info::AccountInfo<'a>, + /// Use Authority Record PDA If present the program Assumes a delegated use authority + pub use_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Program As Signer (Burner) + pub burner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UtilizeInstructionArgs, +} + +impl<'a> UtilizeCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let mut accounts = Vec::with_capacity(11); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.token_account.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.use_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.owner.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.token_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.ata_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.rent.key, + false, + )); + if let Some(use_authority_record) = self.use_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new( + *use_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(burner) = self.burner { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *burner.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: self.__args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(11 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.token_account.clone()); + account_infos.push(self.mint.clone()); + account_infos.push(self.use_authority.clone()); + account_infos.push(self.owner.clone()); + account_infos.push(self.token_program.clone()); + account_infos.push(self.ata_program.clone()); + account_infos.push(self.system_program.clone()); + account_infos.push(self.rent.clone()); + if let Some(use_authority_record) = self.use_authority_record { + account_infos.push(use_authority_record.clone()); + } + if let Some(burner) = self.burner { + account_infos.push(burner.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `utilize` CPI instruction builder. +pub struct UtilizeCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> UtilizeCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(UtilizeCpiBuilderInstruction { + __program: program, + metadata: None, + token_account: None, + mint: None, + use_authority: None, + owner: None, + token_program: None, + ata_program: None, + system_program: None, + rent: None, + use_authority_record: None, + burner: None, + number_of_uses: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn token_account( + &mut self, + token_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_account = Some(token_account); + self + } + pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.mint = Some(mint); + self + } + pub fn use_authority( + &mut self, + use_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.use_authority = Some(use_authority); + self + } + pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.owner = Some(owner); + self + } + pub fn token_program( + &mut self, + token_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.token_program = Some(token_program); + self + } + pub fn ata_program( + &mut self, + ata_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.ata_program = Some(ata_program); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.rent = Some(rent); + self + } + pub fn use_authority_record( + &mut self, + use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.use_authority_record = Some(use_authority_record); + self + } + pub fn burner( + &mut self, + burner: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.burner = Some(burner); + self + } + pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { + self.instruction.number_of_uses = Some(number_of_uses); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> UtilizeCpi<'a> { + let args = UtilizeInstructionArgs::new( + self.instruction + .number_of_uses + .clone() + .expect("number_of_uses is not set"), + ); + + UtilizeCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + token_account: self + .instruction + .token_account + .expect("token_account is not set"), + + mint: self.instruction.mint.expect("mint is not set"), + + use_authority: self + .instruction + .use_authority + .expect("use_authority is not set"), + + owner: self.instruction.owner.expect("owner is not set"), + + token_program: self + .instruction + .token_program + .expect("token_program is not set"), + + ata_program: self + .instruction + .ata_program + .expect("ata_program is not set"), + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + rent: self.instruction.rent.expect("rent is not set"), + + use_authority_record: self.instruction.use_authority_record, + + burner: self.instruction.burner, + __args: args, + } + } +} + +struct UtilizeCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + use_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + token_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + ata_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + rent: Option<&'a solana_program::account_info::AccountInfo<'a>>, + use_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + burner: Option<&'a solana_program::account_info::AccountInfo<'a>>, + number_of_uses: Option, +} diff --git a/clients/rust/src/generated/instructions/verify_collection.rs b/clients/rust/src/generated/instructions/verify_collection.rs new file mode 100644 index 00000000..f3e124cd --- /dev/null +++ b/clients/rust/src/generated/instructions/verify_collection.rs @@ -0,0 +1,365 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct VerifyCollection { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Collection Update authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection: solana_program::pubkey::Pubkey, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl VerifyCollection { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = VerifyCollectionInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_master_edition_account, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct VerifyCollectionInstructionArgs { + discriminator: u8, +} + +impl VerifyCollectionInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 18 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct VerifyCollectionBuilder { + metadata: Option, + collection_authority: Option, + payer: Option, + collection_mint: Option, + collection: Option, + collection_master_edition_account: Option, + collection_authority_record: Option, +} + +impl VerifyCollectionBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition_account = Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = VerifyCollection { + metadata: self.metadata.expect("metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + payer: self.payer.expect("payer is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection: self.collection.expect("collection is not set"), + collection_master_edition_account: self + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + collection_authority_record: self.collection_authority_record, + }; + + accounts.instruction() + } +} + +/// `verify_collection` CPI instruction. +pub struct VerifyCollectionCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Update authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> VerifyCollectionCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = VerifyCollectionInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_master_edition_account.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.collection.clone()); + account_infos.push(self.collection_master_edition_account.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `verify_collection` CPI instruction builder. +pub struct VerifyCollectionCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> VerifyCollectionCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(VerifyCollectionCpiBuilderInstruction { + __program: program, + metadata: None, + collection_authority: None, + payer: None, + collection_mint: None, + collection: None, + collection_master_edition_account: None, + collection_authority_record: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection( + &mut self, + collection: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition_account = + Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> VerifyCollectionCpi<'a> { + VerifyCollectionCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection: self.instruction.collection.expect("collection is not set"), + + collection_master_edition_account: self + .instruction + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + } + } +} + +struct VerifyCollectionCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/verify_collection_v1.rs b/clients/rust/src/generated/instructions/verify_collection_v1.rs new file mode 100644 index 00000000..f4f5dda3 --- /dev/null +++ b/clients/rust/src/generated/instructions/verify_collection_v1.rs @@ -0,0 +1,427 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct VerifyCollectionV1 { + /// Creator to verify, collection update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection_metadata: Option, + /// Master Edition Account of the Collection Token + pub collection_master_edition: Option, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, +} + +impl VerifyCollectionV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = VerifyCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + collection_metadata, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_master_edition) = self.collection_master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct VerifyCollectionV1InstructionArgs { + discriminator: u8, + verify_collection_v1_discriminator: u8, +} + +impl VerifyCollectionV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 52, + verify_collection_v1_discriminator: 1, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct VerifyCollectionV1Builder { + authority: Option, + delegate_record: Option, + metadata: Option, + collection_mint: Option, + collection_metadata: Option, + collection_master_edition: Option, + system_program: Option, + sysvar_instructions: Option, +} + +impl VerifyCollectionV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_master_edition( + &mut self, + collection_master_edition: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition = Some(collection_master_edition); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = VerifyCollectionV1 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + metadata: self.metadata.expect("metadata is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection_metadata: self.collection_metadata, + collection_master_edition: self.collection_master_edition, + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + }; + + accounts.instruction() + } +} + +/// `verify_collection_v1` CPI instruction. +pub struct VerifyCollectionV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Creator to verify, collection update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Master Edition Account of the Collection Token + pub collection_master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> VerifyCollectionV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = VerifyCollectionV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + *collection_metadata.key, + false, + )); + } + if let Some(collection_master_edition) = self.collection_master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_master_edition.key, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(8 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_mint.clone()); + if let Some(collection_metadata) = self.collection_metadata { + account_infos.push(collection_metadata.clone()); + } + if let Some(collection_master_edition) = self.collection_master_edition { + account_infos.push(collection_master_edition.clone()); + } + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `verify_collection_v1` CPI instruction builder. +pub struct VerifyCollectionV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> VerifyCollectionV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(VerifyCollectionV1CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + metadata: None, + collection_mint: None, + collection_metadata: None, + collection_master_edition: None, + system_program: None, + sysvar_instructions: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_master_edition( + &mut self, + collection_master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition = Some(collection_master_edition); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> VerifyCollectionV1Cpi<'a> { + VerifyCollectionV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection_metadata: self.instruction.collection_metadata, + + collection_master_edition: self.instruction.collection_master_edition, + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + } + } +} + +struct VerifyCollectionV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/verify_creator_v1.rs b/clients/rust/src/generated/instructions/verify_creator_v1.rs new file mode 100644 index 00000000..4c6652d1 --- /dev/null +++ b/clients/rust/src/generated/instructions/verify_creator_v1.rs @@ -0,0 +1,450 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct VerifyCreatorV1 { + /// Creator to verify, collection update authority or delegate + pub authority: solana_program::pubkey::Pubkey, + /// Delegate record PDA + pub delegate_record: Option, + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: Option, + /// Metadata Account of the Collection + pub collection_metadata: Option, + /// Master Edition Account of the Collection Token + pub collection_master_edition: Option, + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, +} + +impl VerifyCreatorV1 { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = VerifyCreatorV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.authority, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + delegate_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + if let Some(collection_mint) = self.collection_mint { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_mint, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + collection_metadata, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_master_edition) = self.collection_master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_master_edition, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.system_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.sysvar_instructions, + false, + )); + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct VerifyCreatorV1InstructionArgs { + discriminator: u8, + verify_creator_v1_discriminator: u8, +} + +impl VerifyCreatorV1InstructionArgs { + pub fn new() -> Self { + Self { + discriminator: 52, + verify_creator_v1_discriminator: 0, + } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct VerifyCreatorV1Builder { + authority: Option, + delegate_record: Option, + metadata: Option, + collection_mint: Option, + collection_metadata: Option, + collection_master_edition: Option, + system_program: Option, + sysvar_instructions: Option, +} + +impl VerifyCreatorV1Builder { + pub fn new() -> Self { + Self::default() + } + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.delegate_record = Some(delegate_record); + self + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_master_edition( + &mut self, + collection_master_edition: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition = Some(collection_master_edition); + self + } + pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = VerifyCreatorV1 { + authority: self.authority.expect("authority is not set"), + delegate_record: self.delegate_record, + metadata: self.metadata.expect("metadata is not set"), + collection_mint: self.collection_mint, + collection_metadata: self.collection_metadata, + collection_master_edition: self.collection_master_edition, + system_program: self + .system_program + .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), + sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!( + "Sysvar1nstructions1111111111111111111111111" + )), + }; + + accounts.instruction() + } +} + +/// `verify_creator_v1` CPI instruction. +pub struct VerifyCreatorV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Creator to verify, collection update authority or delegate + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Delegate record PDA + pub delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Metadata Account of the Collection + pub collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Master Edition Account of the Collection Token + pub collection_master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, +} + +impl<'a> VerifyCreatorV1Cpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = VerifyCreatorV1InstructionArgs::new(); + + let mut accounts = Vec::with_capacity(8); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.authority.key, + true, + )); + if let Some(delegate_record) = self.delegate_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *delegate_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + if let Some(collection_mint) = self.collection_mint { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_mint.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_metadata) = self.collection_metadata { + accounts.push(solana_program::instruction::AccountMeta::new( + *collection_metadata.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + if let Some(collection_master_edition) = self.collection_master_edition { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_master_edition.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.system_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.sysvar_instructions.key, + false, + )); + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(8 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.authority.clone()); + if let Some(delegate_record) = self.delegate_record { + account_infos.push(delegate_record.clone()); + } + account_infos.push(self.metadata.clone()); + if let Some(collection_mint) = self.collection_mint { + account_infos.push(collection_mint.clone()); + } + if let Some(collection_metadata) = self.collection_metadata { + account_infos.push(collection_metadata.clone()); + } + if let Some(collection_master_edition) = self.collection_master_edition { + account_infos.push(collection_master_edition.clone()); + } + account_infos.push(self.system_program.clone()); + account_infos.push(self.sysvar_instructions.clone()); + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `verify_creator_v1` CPI instruction builder. +pub struct VerifyCreatorV1CpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> VerifyCreatorV1CpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(VerifyCreatorV1CpiBuilderInstruction { + __program: program, + authority: None, + delegate_record: None, + metadata: None, + collection_mint: None, + collection_metadata: None, + collection_master_edition: None, + system_program: None, + sysvar_instructions: None, + }); + Self { instruction } + } + pub fn authority( + &mut self, + authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); + self + } + pub fn delegate_record( + &mut self, + delegate_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.delegate_record = Some(delegate_record); + self + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection_metadata( + &mut self, + collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_metadata = Some(collection_metadata); + self + } + pub fn collection_master_edition( + &mut self, + collection_master_edition: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition = Some(collection_master_edition); + self + } + pub fn system_program( + &mut self, + system_program: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.system_program = Some(system_program); + self + } + pub fn sysvar_instructions( + &mut self, + sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.sysvar_instructions = Some(sysvar_instructions); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> VerifyCreatorV1Cpi<'a> { + VerifyCreatorV1Cpi { + __program: self.instruction.__program, + + authority: self.instruction.authority.expect("authority is not set"), + + delegate_record: self.instruction.delegate_record, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_mint: self.instruction.collection_mint, + + collection_metadata: self.instruction.collection_metadata, + + collection_master_edition: self.instruction.collection_master_edition, + + system_program: self + .instruction + .system_program + .expect("system_program is not set"), + + sysvar_instructions: self + .instruction + .sysvar_instructions + .expect("sysvar_instructions is not set"), + } + } +} + +struct VerifyCreatorV1CpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + delegate_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs new file mode 100644 index 00000000..cdf37b78 --- /dev/null +++ b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs @@ -0,0 +1,365 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +/// Accounts. +pub struct VerifySizedCollectionItem { + /// Metadata account + pub metadata: solana_program::pubkey::Pubkey, + /// Collection Update authority + pub collection_authority: solana_program::pubkey::Pubkey, + /// payer + pub payer: solana_program::pubkey::Pubkey, + /// Mint of the Collection + pub collection_mint: solana_program::pubkey::Pubkey, + /// Metadata Account of the Collection + pub collection: solana_program::pubkey::Pubkey, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: solana_program::pubkey::Pubkey, + /// Collection Authority Record PDA + pub collection_authority_record: Option, +} + +impl VerifySizedCollectionItem { + #[allow(clippy::vec_init_then_push)] + pub fn instruction(&self) -> solana_program::instruction::Instruction { + let args = VerifySizedCollectionItemInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + self.metadata, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_authority, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.payer, true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_mint, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + self.collection, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.collection_master_edition_account, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + collection_authority_record, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +struct VerifySizedCollectionItemInstructionArgs { + discriminator: u8, +} + +impl VerifySizedCollectionItemInstructionArgs { + pub fn new() -> Self { + Self { discriminator: 30 } + } +} + +/// Instruction builder. +#[derive(Default)] +pub struct VerifySizedCollectionItemBuilder { + metadata: Option, + collection_authority: Option, + payer: Option, + collection_mint: Option, + collection: Option, + collection_master_edition_account: Option, + collection_authority_record: Option, +} + +impl VerifySizedCollectionItemBuilder { + pub fn new() -> Self { + Self::default() + } + pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { + self.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { + self.payer = Some(payer); + self + } + pub fn collection_mint( + &mut self, + collection_mint: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_mint = Some(collection_mint); + self + } + pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { + self.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_master_edition_account = Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: solana_program::pubkey::Pubkey, + ) -> &mut Self { + self.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> solana_program::instruction::Instruction { + let accounts = VerifySizedCollectionItem { + metadata: self.metadata.expect("metadata is not set"), + collection_authority: self + .collection_authority + .expect("collection_authority is not set"), + payer: self.payer.expect("payer is not set"), + collection_mint: self.collection_mint.expect("collection_mint is not set"), + collection: self.collection.expect("collection is not set"), + collection_master_edition_account: self + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + collection_authority_record: self.collection_authority_record, + }; + + accounts.instruction() + } +} + +/// `verify_sized_collection_item` CPI instruction. +pub struct VerifySizedCollectionItemCpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata account + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Update authority + pub collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Mint of the Collection + pub collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata Account of the Collection + pub collection: &'a solana_program::account_info::AccountInfo<'a>, + /// MasterEdition2 Account of the Collection Token + pub collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + /// Collection Authority Record PDA + pub collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} + +impl<'a> VerifySizedCollectionItemCpi<'a> { + pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + self.invoke_signed(&[]) + } + #[allow(clippy::clone_on_copy)] + #[allow(clippy::vec_init_then_push)] + pub fn invoke_signed( + &self, + signers_seeds: &[&[&[u8]]], + ) -> solana_program::entrypoint::ProgramResult { + let args = VerifySizedCollectionItemInstructionArgs::new(); + + let mut accounts = Vec::with_capacity(7); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.metadata.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_authority.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.payer.key, + true, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_mint.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new( + *self.collection.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.collection_master_edition_account.key, + false, + )); + if let Some(collection_authority_record) = self.collection_authority_record { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *collection_authority_record.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); + } + + let instruction = solana_program::instruction::Instruction { + program_id: crate::MPL_TOKEN_METADATA_ID, + accounts, + data: args.try_to_vec().unwrap(), + }; + let mut account_infos = Vec::with_capacity(7 + 1); + account_infos.push(self.__program.clone()); + account_infos.push(self.metadata.clone()); + account_infos.push(self.collection_authority.clone()); + account_infos.push(self.payer.clone()); + account_infos.push(self.collection_mint.clone()); + account_infos.push(self.collection.clone()); + account_infos.push(self.collection_master_edition_account.clone()); + if let Some(collection_authority_record) = self.collection_authority_record { + account_infos.push(collection_authority_record.clone()); + } + + if signers_seeds.is_empty() { + solana_program::program::invoke(&instruction, &account_infos) + } else { + solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + } + } +} + +/// `verify_sized_collection_item` CPI instruction builder. +pub struct VerifySizedCollectionItemCpiBuilder<'a> { + instruction: Box>, +} + +impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { + pub fn new(program: &'a solana_program::account_info::AccountInfo<'a>) -> Self { + let instruction = Box::new(VerifySizedCollectionItemCpiBuilderInstruction { + __program: program, + metadata: None, + collection_authority: None, + payer: None, + collection_mint: None, + collection: None, + collection_master_edition_account: None, + collection_authority_record: None, + }); + Self { instruction } + } + pub fn metadata( + &mut self, + metadata: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.metadata = Some(metadata); + self + } + pub fn collection_authority( + &mut self, + collection_authority: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority = Some(collection_authority); + self + } + pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { + self.instruction.payer = Some(payer); + self + } + pub fn collection_mint( + &mut self, + collection_mint: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_mint = Some(collection_mint); + self + } + pub fn collection( + &mut self, + collection: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection = Some(collection); + self + } + pub fn collection_master_edition_account( + &mut self, + collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_master_edition_account = + Some(collection_master_edition_account); + self + } + pub fn collection_authority_record( + &mut self, + collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.collection_authority_record = Some(collection_authority_record); + self + } + #[allow(clippy::clone_on_copy)] + pub fn build(&self) -> VerifySizedCollectionItemCpi<'a> { + VerifySizedCollectionItemCpi { + __program: self.instruction.__program, + + metadata: self.instruction.metadata.expect("metadata is not set"), + + collection_authority: self + .instruction + .collection_authority + .expect("collection_authority is not set"), + + payer: self.instruction.payer.expect("payer is not set"), + + collection_mint: self + .instruction + .collection_mint + .expect("collection_mint is not set"), + + collection: self.instruction.collection.expect("collection is not set"), + + collection_master_edition_account: self + .instruction + .collection_master_edition_account + .expect("collection_master_edition_account is not set"), + + collection_authority_record: self.instruction.collection_authority_record, + } + } +} + +struct VerifySizedCollectionItemCpiBuilderInstruction<'a> { + __program: &'a solana_program::account_info::AccountInfo<'a>, + metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + payer: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_master_edition_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, + collection_authority_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, +} diff --git a/clients/rust/src/generated/mod.rs b/clients/rust/src/generated/mod.rs new file mode 100644 index 00000000..5a39b0d1 --- /dev/null +++ b/clients/rust/src/generated/mod.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +pub mod accounts; +pub mod errors; +pub mod instructions; +pub mod programs; +pub mod types; + +pub use programs::*; diff --git a/clients/rust/src/generated/programs.rs b/clients/rust/src/generated/programs.rs new file mode 100644 index 00000000..a485a909 --- /dev/null +++ b/clients/rust/src/generated/programs.rs @@ -0,0 +1,11 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use solana_program::{pubkey, pubkey::Pubkey}; + +/// `mpl_token_metadata` program ID. +pub const MPL_TOKEN_METADATA_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); diff --git a/clients/rust/src/generated/types/authority_type.rs b/clients/rust/src/generated/types/authority_type.rs new file mode 100644 index 00000000..81fae4a4 --- /dev/null +++ b/clients/rust/src/generated/types/authority_type.rs @@ -0,0 +1,18 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum AuthorityType { + None, + Metadata, + Holder, + MetadataDelegate, + TokenDelegate, +} diff --git a/clients/rust/src/generated/types/authorization_data.rs b/clients/rust/src/generated/types/authorization_data.rs new file mode 100644 index 00000000..abc517cb --- /dev/null +++ b/clients/rust/src/generated/types/authorization_data.rs @@ -0,0 +1,15 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Payload; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct AuthorizationData { + pub payload: Payload, +} diff --git a/clients/rust/src/generated/types/burn_args.rs b/clients/rust/src/generated/types/burn_args.rs new file mode 100644 index 00000000..074c861f --- /dev/null +++ b/clients/rust/src/generated/types/burn_args.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum BurnArgs { + V1 { amount: u64 }, +} diff --git a/clients/rust/src/generated/types/collection.rs b/clients/rust/src/generated/types/collection.rs new file mode 100644 index 00000000..7594da63 --- /dev/null +++ b/clients/rust/src/generated/types/collection.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Collection { + pub verified: bool, + pub key: Pubkey, +} diff --git a/clients/rust/src/generated/types/collection_details.rs b/clients/rust/src/generated/types/collection_details.rs new file mode 100644 index 00000000..1a059b62 --- /dev/null +++ b/clients/rust/src/generated/types/collection_details.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum CollectionDetails { + V1 { size: u64 }, +} diff --git a/clients/rust/src/generated/types/collection_details_toggle.rs b/clients/rust/src/generated/types/collection_details_toggle.rs new file mode 100644 index 00000000..86ad4733 --- /dev/null +++ b/clients/rust/src/generated/types/collection_details_toggle.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::CollectionDetails; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum CollectionDetailsToggle { + None, + Clear, + Set(CollectionDetails), +} diff --git a/clients/rust/src/generated/types/collection_toggle.rs b/clients/rust/src/generated/types/collection_toggle.rs new file mode 100644 index 00000000..c032e79f --- /dev/null +++ b/clients/rust/src/generated/types/collection_toggle.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Collection; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum CollectionToggle { + None, + Clear, + Set(Collection), +} diff --git a/clients/rust/src/generated/types/create_args.rs b/clients/rust/src/generated/types/create_args.rs new file mode 100644 index 00000000..0c35f5b9 --- /dev/null +++ b/clients/rust/src/generated/types/create_args.rs @@ -0,0 +1,36 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Collection; +use crate::generated::types::CollectionDetails; +use crate::generated::types::Creator; +use crate::generated::types::PrintSupply; +use crate::generated::types::TokenStandard; +use crate::generated::types::Uses; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum CreateArgs { + V1 { + name: String, + symbol: String, + uri: String, + seller_fee_basis_points: u16, + creators: Option>, + primary_sale_happened: bool, + is_mutable: bool, + token_standard: TokenStandard, + collection: Option, + uses: Option, + collection_details: Option, + rule_set: Option, + decimals: Option, + print_supply: Option, + }, +} diff --git a/clients/rust/src/generated/types/creator.rs b/clients/rust/src/generated/types/creator.rs new file mode 100644 index 00000000..7c7eb67a --- /dev/null +++ b/clients/rust/src/generated/types/creator.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Creator { + pub address: Pubkey, + pub verified: bool, + pub share: u8, +} diff --git a/clients/rust/src/generated/types/data_v2.rs b/clients/rust/src/generated/types/data_v2.rs new file mode 100644 index 00000000..f56842a3 --- /dev/null +++ b/clients/rust/src/generated/types/data_v2.rs @@ -0,0 +1,23 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Collection; +use crate::generated::types::Creator; +use crate::generated::types::Uses; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct DataV2 { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, + pub collection: Option, + pub uses: Option, +} diff --git a/clients/rust/src/generated/types/delegate_args.rs b/clients/rust/src/generated/types/delegate_args.rs new file mode 100644 index 00000000..1f72db30 --- /dev/null +++ b/clients/rust/src/generated/types/delegate_args.rs @@ -0,0 +1,60 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum DelegateArgs { + CollectionV1 { + authorization_data: Option, + }, + SaleV1 { + amount: u64, + authorization_data: Option, + }, + TransferV1 { + amount: u64, + authorization_data: Option, + }, + DataV1 { + authorization_data: Option, + }, + UtilityV1 { + amount: u64, + authorization_data: Option, + }, + StakingV1 { + amount: u64, + authorization_data: Option, + }, + StandardV1 { + amount: u64, + }, + LockedTransferV1 { + amount: u64, + locked_address: Pubkey, + authorization_data: Option, + }, + ProgrammableConfigV1 { + authorization_data: Option, + }, + AuthorityItemV1 { + authorization_data: Option, + }, + DataItemV1 { + authorization_data: Option, + }, + CollectionItemV1 { + authorization_data: Option, + }, + ProgrammableConfigItemV1 { + authorization_data: Option, + }, +} diff --git a/clients/rust/src/generated/types/escrow_authority.rs b/clients/rust/src/generated/types/escrow_authority.rs new file mode 100644 index 00000000..22d11bc8 --- /dev/null +++ b/clients/rust/src/generated/types/escrow_authority.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum EscrowAuthority { + TokenOwner, + Creator(Pubkey), +} diff --git a/clients/rust/src/generated/types/helper/mod.rs b/clients/rust/src/generated/types/helper/mod.rs new file mode 100644 index 00000000..1cf7bfa8 --- /dev/null +++ b/clients/rust/src/generated/types/helper/mod.rs @@ -0,0 +1,96 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use std::fmt::Debug; +use std::io::Write; +use std::ops::{Deref, DerefMut}; + +use borsh::maybestd::io::Read; +use borsh::{BorshDeserialize, BorshSerialize}; + +/// A vector that deserializes from a stream of bytes. +/// +/// This is useful for deserializing a vector that does not have +/// a length prefix. In order to determine how many elements to deserialize, +/// the type of the elements must implement the trait `Sized`. +pub struct RemainderVec(Vec); + +/// Deferences the inner `Vec` type. +impl Deref for RemainderVec +where + T: BorshSerialize + BorshDeserialize, +{ + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +/// Deferences the inner `Vec` type as mutable. +impl DerefMut for RemainderVec +where + T: BorshSerialize + BorshDeserialize, +{ + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +/// `Debug` implementation for `RemainderVec`. +/// +/// This implementation simply forwards to the inner `Vec` type. +impl Debug for RemainderVec +where + T: BorshSerialize + BorshDeserialize + Debug, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_fmt(format_args!("{:?}", self.0)) + } +} + +impl BorshDeserialize for RemainderVec +where + T: BorshSerialize + BorshDeserialize, +{ + fn deserialize_reader(reader: &mut R) -> borsh::maybestd::io::Result { + let length = std::mem::size_of::(); + // buffer to read the data + let mut buffer = vec![0u8; length]; + // vec to store the items + let mut items: Vec = Vec::new(); + + loop { + match reader.read(&mut buffer)? { + 0 => break, + n if n == length => items.push(T::deserialize(&mut buffer.as_slice())?), + e => { + return Err(borsh::maybestd::io::Error::new( + borsh::maybestd::io::ErrorKind::InvalidData, + format!("unexpected number of bytes (read {e}, expected {length})"), + )) + } + } + } + + Ok(Self(items)) + } +} + +impl BorshSerialize for RemainderVec +where + T: BorshSerialize + BorshDeserialize, +{ + fn serialize(&self, writer: &mut W) -> borsh::maybestd::io::Result<()> { + // serialize each item without adding a prefix for the length + for item in self.0.iter() { + item.serialize(writer)?; + } + + Ok(()) + } +} diff --git a/clients/rust/src/generated/types/key.rs b/clients/rust/src/generated/types/key.rs new file mode 100644 index 00000000..be3c0150 --- /dev/null +++ b/clients/rust/src/generated/types/key.rs @@ -0,0 +1,27 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum Key { + Uninitialized, + EditionV1, + MasterEditionV1, + ReservationListV1, + MetadataV1, + ReservationListV2, + MasterEditionV2, + EditionMarker, + UseAuthorityRecord, + CollectionAuthorityRecord, + TokenOwnedEscrow, + TokenRecord, + MetadataDelegate, + EditionMarkerV2, +} diff --git a/clients/rust/src/generated/types/leaf_info.rs b/clients/rust/src/generated/types/leaf_info.rs new file mode 100644 index 00000000..a049bf8c --- /dev/null +++ b/clients/rust/src/generated/types/leaf_info.rs @@ -0,0 +1,15 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct LeafInfo { + pub leaf: [u8; 32], + pub proof: Vec<[u8; 32]>, +} diff --git a/clients/rust/src/generated/types/lock_args.rs b/clients/rust/src/generated/types/lock_args.rs new file mode 100644 index 00000000..be307f2e --- /dev/null +++ b/clients/rust/src/generated/types/lock_args.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum LockArgs { + V1 { + authorization_data: Option, + }, +} diff --git a/clients/rust/src/generated/types/metadata_delegate_role.rs b/clients/rust/src/generated/types/metadata_delegate_role.rs new file mode 100644 index 00000000..ff51d00c --- /dev/null +++ b/clients/rust/src/generated/types/metadata_delegate_role.rs @@ -0,0 +1,21 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum MetadataDelegateRole { + AuthorityItem, + Collection, + Use, + Data, + ProgrammableConfig, + DataItem, + CollectionItem, + ProgrammableConfigItem, +} diff --git a/clients/rust/src/generated/types/migration_type.rs b/clients/rust/src/generated/types/migration_type.rs new file mode 100644 index 00000000..f070abaf --- /dev/null +++ b/clients/rust/src/generated/types/migration_type.rs @@ -0,0 +1,15 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum MigrationType { + CollectionV1, + ProgrammableV1, +} diff --git a/clients/rust/src/generated/types/mint_args.rs b/clients/rust/src/generated/types/mint_args.rs new file mode 100644 index 00000000..32a9a1f9 --- /dev/null +++ b/clients/rust/src/generated/types/mint_args.rs @@ -0,0 +1,18 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum MintArgs { + V1 { + amount: u64, + authorization_data: Option, + }, +} diff --git a/clients/rust/src/generated/types/mint_new_edition_from_master_edition_via_token_args.rs b/clients/rust/src/generated/types/mint_new_edition_from_master_edition_via_token_args.rs new file mode 100644 index 00000000..7843f89a --- /dev/null +++ b/clients/rust/src/generated/types/mint_new_edition_from_master_edition_via_token_args.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct MintNewEditionFromMasterEditionViaTokenArgs { + pub edition: u64, +} diff --git a/clients/rust/src/generated/types/mod.rs b/clients/rust/src/generated/types/mod.rs new file mode 100644 index 00000000..cad0b17c --- /dev/null +++ b/clients/rust/src/generated/types/mod.rs @@ -0,0 +1,92 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +mod authority_type; +mod authorization_data; +mod burn_args; +mod collection; +mod collection_details; +mod collection_details_toggle; +mod collection_toggle; +mod create_args; +mod creator; +mod data_v2; +mod delegate_args; +mod escrow_authority; +mod key; +mod leaf_info; +mod lock_args; +mod metadata_delegate_role; +mod migration_type; +mod mint_args; +mod mint_new_edition_from_master_edition_via_token_args; +mod payload; +mod payload_key; +mod payload_type; +mod print_args; +mod print_supply; +mod programmable_config; +mod reservation; +mod reservation_v1; +mod revoke_args; +mod rule_set_toggle; +mod seeds_vec; +mod set_collection_size_args; +mod token_delegate_role; +mod token_standard; +mod token_state; +mod transfer_args; +mod unlock_args; +mod update_args; +mod use_args; +mod use_method; +mod uses; +mod uses_toggle; +mod verification_args; + +pub use authority_type::*; +pub use authorization_data::*; +pub use burn_args::*; +pub use collection::*; +pub use collection_details::*; +pub use collection_details_toggle::*; +pub use collection_toggle::*; +pub use create_args::*; +pub use creator::*; +pub use data_v2::*; +pub use delegate_args::*; +pub use escrow_authority::*; +pub use key::*; +pub use leaf_info::*; +pub use lock_args::*; +pub use metadata_delegate_role::*; +pub use migration_type::*; +pub use mint_args::*; +pub use mint_new_edition_from_master_edition_via_token_args::*; +pub use payload::*; +pub use payload_key::*; +pub use payload_type::*; +pub use print_args::*; +pub use print_supply::*; +pub use programmable_config::*; +pub use reservation::*; +pub use reservation_v1::*; +pub use revoke_args::*; +pub use rule_set_toggle::*; +pub use seeds_vec::*; +pub use set_collection_size_args::*; +pub use token_delegate_role::*; +pub use token_standard::*; +pub use token_state::*; +pub use transfer_args::*; +pub use unlock_args::*; +pub use update_args::*; +pub use use_args::*; +pub use use_method::*; +pub use uses::*; +pub use uses_toggle::*; +pub use verification_args::*; diff --git a/clients/rust/src/generated/types/payload.rs b/clients/rust/src/generated/types/payload.rs new file mode 100644 index 00000000..c64092c3 --- /dev/null +++ b/clients/rust/src/generated/types/payload.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::PayloadType; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use std::collections::HashMap; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Payload { + pub map: HashMap, +} diff --git a/clients/rust/src/generated/types/payload_key.rs b/clients/rust/src/generated/types/payload_key.rs new file mode 100644 index 00000000..7a0e3287 --- /dev/null +++ b/clients/rust/src/generated/types/payload_key.rs @@ -0,0 +1,23 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum PayloadKey { + Amount, + Authority, + AuthoritySeeds, + Delegate, + DelegateSeeds, + Destination, + DestinationSeeds, + Holder, + Source, + SourceSeeds, +} diff --git a/clients/rust/src/generated/types/payload_type.rs b/clients/rust/src/generated/types/payload_type.rs new file mode 100644 index 00000000..ab281ff2 --- /dev/null +++ b/clients/rust/src/generated/types/payload_type.rs @@ -0,0 +1,20 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::LeafInfo; +use crate::generated::types::SeedsVec; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum PayloadType { + Pubkey(Pubkey), + Seeds(SeedsVec), + MerkleProof(LeafInfo), + Number(u64), +} diff --git a/clients/rust/src/generated/types/print_args.rs b/clients/rust/src/generated/types/print_args.rs new file mode 100644 index 00000000..7b013479 --- /dev/null +++ b/clients/rust/src/generated/types/print_args.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum PrintArgs { + V1 { edition: u64 }, +} diff --git a/clients/rust/src/generated/types/print_supply.rs b/clients/rust/src/generated/types/print_supply.rs new file mode 100644 index 00000000..71c85fa2 --- /dev/null +++ b/clients/rust/src/generated/types/print_supply.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum PrintSupply { + Zero, + Limited(u64), + Unlimited, +} diff --git a/clients/rust/src/generated/types/programmable_config.rs b/clients/rust/src/generated/types/programmable_config.rs new file mode 100644 index 00000000..9d2f51ec --- /dev/null +++ b/clients/rust/src/generated/types/programmable_config.rs @@ -0,0 +1,15 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum ProgrammableConfig { + V1 { rule_set: Option }, +} diff --git a/clients/rust/src/generated/types/reservation.rs b/clients/rust/src/generated/types/reservation.rs new file mode 100644 index 00000000..8cdb53e5 --- /dev/null +++ b/clients/rust/src/generated/types/reservation.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Reservation { + pub address: Pubkey, + pub spots_remaining: u64, + pub total_spots: u64, +} diff --git a/clients/rust/src/generated/types/reservation_v1.rs b/clients/rust/src/generated/types/reservation_v1.rs new file mode 100644 index 00000000..77c4fce5 --- /dev/null +++ b/clients/rust/src/generated/types/reservation_v1.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct ReservationV1 { + pub address: Pubkey, + pub spots_remaining: u8, + pub total_spots: u8, +} diff --git a/clients/rust/src/generated/types/revoke_args.rs b/clients/rust/src/generated/types/revoke_args.rs new file mode 100644 index 00000000..51ff5ee5 --- /dev/null +++ b/clients/rust/src/generated/types/revoke_args.rs @@ -0,0 +1,27 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum RevokeArgs { + CollectionV1, + SaleV1, + TransferV1, + DataV1, + UtilityV1, + StakingV1, + StandardV1, + LockedTransferV1, + ProgrammableConfigV1, + MigrationV1, + AuthorityItemV1, + DataItemV1, + CollectionItemV1, + ProgrammableConfigItemV1, +} diff --git a/clients/rust/src/generated/types/rule_set_toggle.rs b/clients/rust/src/generated/types/rule_set_toggle.rs new file mode 100644 index 00000000..338e0296 --- /dev/null +++ b/clients/rust/src/generated/types/rule_set_toggle.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum RuleSetToggle { + None, + Clear, + Set(Pubkey), +} diff --git a/clients/rust/src/generated/types/seeds_vec.rs b/clients/rust/src/generated/types/seeds_vec.rs new file mode 100644 index 00000000..3fff94e6 --- /dev/null +++ b/clients/rust/src/generated/types/seeds_vec.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct SeedsVec { + pub seeds: Vec>, +} diff --git a/clients/rust/src/generated/types/set_collection_size_args.rs b/clients/rust/src/generated/types/set_collection_size_args.rs new file mode 100644 index 00000000..7e42fdf8 --- /dev/null +++ b/clients/rust/src/generated/types/set_collection_size_args.rs @@ -0,0 +1,14 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct SetCollectionSizeArgs { + pub size: u64, +} diff --git a/clients/rust/src/generated/types/token_delegate_role.rs b/clients/rust/src/generated/types/token_delegate_role.rs new file mode 100644 index 00000000..5bdf99bd --- /dev/null +++ b/clients/rust/src/generated/types/token_delegate_role.rs @@ -0,0 +1,20 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum TokenDelegateRole { + Sale, + Transfer, + Utility, + Staking, + Standard, + LockedTransfer, + Migration, +} diff --git a/clients/rust/src/generated/types/token_standard.rs b/clients/rust/src/generated/types/token_standard.rs new file mode 100644 index 00000000..6846a51d --- /dev/null +++ b/clients/rust/src/generated/types/token_standard.rs @@ -0,0 +1,19 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum TokenStandard { + NonFungible, + FungibleAsset, + Fungible, + NonFungibleEdition, + ProgrammableNonFungible, + ProgrammableNonFungibleEdition, +} diff --git a/clients/rust/src/generated/types/token_state.rs b/clients/rust/src/generated/types/token_state.rs new file mode 100644 index 00000000..8995fb59 --- /dev/null +++ b/clients/rust/src/generated/types/token_state.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum TokenState { + Unlocked, + Locked, + Listed, +} diff --git a/clients/rust/src/generated/types/transfer_args.rs b/clients/rust/src/generated/types/transfer_args.rs new file mode 100644 index 00000000..4f6c17df --- /dev/null +++ b/clients/rust/src/generated/types/transfer_args.rs @@ -0,0 +1,18 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum TransferArgs { + V1 { + amount: u64, + authorization_data: Option, + }, +} diff --git a/clients/rust/src/generated/types/unlock_args.rs b/clients/rust/src/generated/types/unlock_args.rs new file mode 100644 index 00000000..ea911a08 --- /dev/null +++ b/clients/rust/src/generated/types/unlock_args.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum UnlockArgs { + V1 { + authorization_data: Option, + }, +} diff --git a/clients/rust/src/generated/types/update_args.rs b/clients/rust/src/generated/types/update_args.rs new file mode 100644 index 00000000..ddec490b --- /dev/null +++ b/clients/rust/src/generated/types/update_args.rs @@ -0,0 +1,108 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use crate::generated::types::CollectionDetailsToggle; +use crate::generated::types::CollectionToggle; +use crate::generated::types::Creator; +use crate::generated::types::RuleSetToggle; +use crate::generated::types::TokenStandard; +use crate::generated::types::UsesToggle; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum UpdateArgs { + V1 { + new_update_authority: Option, + data: Option, + primary_sale_happened: Option, + is_mutable: Option, + collection: CollectionToggle, + collection_details: CollectionDetailsToggle, + uses: UsesToggle, + rule_set: RuleSetToggle, + authorization_data: Option, + }, + AsUpdateAuthorityV2 { + new_update_authority: Option, + data: Option, + primary_sale_happened: Option, + is_mutable: Option, + collection: CollectionToggle, + collection_details: CollectionDetailsToggle, + uses: UsesToggle, + rule_set: RuleSetToggle, + token_standard: Option, + authorization_data: Option, + }, + AsAuthorityItemDelegateV2 { + new_update_authority: Option, + primary_sale_happened: Option, + is_mutable: Option, + token_standard: Option, + authorization_data: Option, + }, + AsCollectionDelegateV2 { + collection: CollectionToggle, + authorization_data: Option, + }, + AsDataDelegateV2 { + data: Option, + authorization_data: Option, + }, + AsProgrammableConfigDelegateV2 { + rule_set: RuleSetToggle, + authorization_data: Option, + }, + AsDataItemDelegateV2 { + data: Option, + authorization_data: Option, + }, + AsCollectionItemDelegateV2 { + collection: CollectionToggle, + authorization_data: Option, + }, + AsProgrammableConfigItemDelegateV2 { + rule_set: RuleSetToggle, + authorization_data: Option, + }, +} + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateArgsV1Data { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateArgsAsUpdateAuthorityV2Data { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateArgsAsDataDelegateV2Data { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpdateArgsAsDataItemDelegateV2Data { + pub name: String, + pub symbol: String, + pub uri: String, + pub seller_fee_basis_points: u16, + pub creators: Option>, +} diff --git a/clients/rust/src/generated/types/use_args.rs b/clients/rust/src/generated/types/use_args.rs new file mode 100644 index 00000000..0ace0ef9 --- /dev/null +++ b/clients/rust/src/generated/types/use_args.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::AuthorizationData; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum UseArgs { + V1 { + authorization_data: Option, + }, +} diff --git a/clients/rust/src/generated/types/use_method.rs b/clients/rust/src/generated/types/use_method.rs new file mode 100644 index 00000000..9b6abd42 --- /dev/null +++ b/clients/rust/src/generated/types/use_method.rs @@ -0,0 +1,16 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum UseMethod { + Burn, + Multiple, + Single, +} diff --git a/clients/rust/src/generated/types/uses.rs b/clients/rust/src/generated/types/uses.rs new file mode 100644 index 00000000..3f5a8e79 --- /dev/null +++ b/clients/rust/src/generated/types/uses.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::UseMethod; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct Uses { + pub use_method: UseMethod, + pub remaining: u64, + pub total: u64, +} diff --git a/clients/rust/src/generated/types/uses_toggle.rs b/clients/rust/src/generated/types/uses_toggle.rs new file mode 100644 index 00000000..f35c7ad8 --- /dev/null +++ b/clients/rust/src/generated/types/uses_toggle.rs @@ -0,0 +1,17 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Uses; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub enum UsesToggle { + None, + Clear, + Set(Uses), +} diff --git a/clients/rust/src/generated/types/verification_args.rs b/clients/rust/src/generated/types/verification_args.rs new file mode 100644 index 00000000..e830b1c2 --- /dev/null +++ b/clients/rust/src/generated/types/verification_args.rs @@ -0,0 +1,15 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] +pub enum VerificationArgs { + CreatorV1, + CollectionV1, +} diff --git a/clients/rust/src/hooked/metadata_delegate_role_seed.rs b/clients/rust/src/hooked/metadata_delegate_role_seed.rs new file mode 100644 index 00000000..7524c1fc --- /dev/null +++ b/clients/rust/src/hooked/metadata_delegate_role_seed.rs @@ -0,0 +1,28 @@ +use std::fmt::{Display, Formatter, Result}; + +use crate::types::MetadataDelegateRole; + +pub struct MetadataDelegateRoleSeed(MetadataDelegateRole); + +impl Display for MetadataDelegateRoleSeed { + fn fmt(&self, f: &mut Formatter) -> Result { + let message = match self.0 { + MetadataDelegateRole::AuthorityItem => "authority_item_delegate".to_string(), + MetadataDelegateRole::Collection => "collection_delegate".to_string(), + MetadataDelegateRole::Use => "use_delegate".to_string(), + MetadataDelegateRole::Data => "data_delegate".to_string(), + MetadataDelegateRole::ProgrammableConfig => "programmable_config_delegate".to_string(), + MetadataDelegateRole::DataItem => "data_item_delegate".to_string(), + MetadataDelegateRole::CollectionItem => "collection_item_delegate".to_string(), + MetadataDelegateRole::ProgrammableConfigItem => "prog_config_item_delegate".to_string(), + }; + + write!(f, "{message}") + } +} + +impl From for MetadataDelegateRoleSeed { + fn from(role: MetadataDelegateRole) -> Self { + MetadataDelegateRoleSeed(role) + } +} diff --git a/clients/rust/src/hooked/mod.rs b/clients/rust/src/hooked/mod.rs new file mode 100644 index 00000000..4fdc1a38 --- /dev/null +++ b/clients/rust/src/hooked/mod.rs @@ -0,0 +1,2 @@ +mod metadata_delegate_role_seed; +pub use metadata_delegate_role_seed::MetadataDelegateRoleSeed; diff --git a/clients/rust/src/lib.rs b/clients/rust/src/lib.rs new file mode 100644 index 00000000..c34990c8 --- /dev/null +++ b/clients/rust/src/lib.rs @@ -0,0 +1,8 @@ +mod generated; +pub use generated::*; + +pub mod hooked; + +pub fn clean(value: String) -> String { + value.replace('\0', "") +} diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index 65a8931e..16650cc3 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -745,3 +745,13 @@ kinobi.update( const jsDir = path.join(clientDir, "js", "src", "generated"); const prettier = require(path.join(clientDir, "js", ".prettierrc.json")); kinobi.accept(new k.RenderJavaScriptVisitor(jsDir, { prettier })); + +// Render Rust. +const crateDir = path.join(clientDir, "rust"); +const rustDir = path.join(clientDir, "rust", "src", "generated"); +kinobi.accept( + new k.RenderRustVisitor(rustDir, { + formatCode: true, + crateFolder: crateDir, + }) +); diff --git a/configs/program-scripts/build.sh b/configs/program-scripts/build.sh index 68c36535..9597fbef 100755 --- a/configs/program-scripts/build.sh +++ b/configs/program-scripts/build.sh @@ -29,9 +29,9 @@ if [ ! -d ${OUTPUT} ]; then fi WORKING_DIR=$(pwd) -export BPF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" +export SBF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" for p in ${PROGRAMS[@]}; do cd ${WORKING_DIR}/programs/${p} - cargo build-bpf --bpf-out-dir ${WORKING_DIR}/${OUTPUT} $ARGS + cargo build-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} $ARGS done diff --git a/configs/program-scripts/sdk.sh b/configs/program-scripts/sdk.sh new file mode 100755 index 00000000..01ee63fd --- /dev/null +++ b/configs/program-scripts/sdk.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +OUTPUT="./programs/.bin" +# go to parent folder +cd $(dirname $(dirname $SCRIPT_DIR)) + +# default to input from the command-line +ARGS=$* + +WORKING_DIR=$(pwd) +SOLFMT="solfmt" +export SBF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" + +# client SDK tests +cd ${WORKING_DIR}/clients/rust + +if [ ! "$(command -v $SOLFMT)" = "" ]; then + CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} +else + cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} +fi diff --git a/configs/program-scripts/test.sh b/configs/program-scripts/test.sh index d10bdef4..e76d13f4 100755 --- a/configs/program-scripts/test.sh +++ b/configs/program-scripts/test.sh @@ -29,14 +29,14 @@ PROGRAMS=$(echo $PROGRAMS | jq -c '.[]' | sed 's/"//g') WORKING_DIR=$(pwd) SOLFMT="solfmt" -export BPF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" +export SBF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" for p in ${PROGRAMS[@]}; do cd ${WORKING_DIR}/programs/${p} if [ ! "$(command -v $SOLFMT)" = "" ]; then - CARGO_TERM_COLOR=always cargo test-bpf --bpf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} + CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} else - cargo test-bpf --bpf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} + cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} fi done From fa24b68d9e8d6d7ac81f21a7f6682eb11588b6a5 Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 17 Aug 2023 21:56:00 +0300 Subject: [PATCH 02/31] wip: update generated code --- .../src/generated/instructions/burn_v1.rs | 15 +++++++++++ .../src/generated/instructions/create_v1.rs | 5 ++++ .../delegate_authority_item_v1.rs | 20 +++++++++++++++ .../delegate_collection_item_v1.rs | 20 +++++++++++++++ .../instructions/delegate_collection_v1.rs | 20 +++++++++++++++ .../instructions/delegate_data_item_v1.rs | 20 +++++++++++++++ .../instructions/delegate_data_v1.rs | 20 +++++++++++++++ .../delegate_locked_transfer_v1.rs | 25 +++++++++++++++++++ .../delegate_programmable_config_item_v1.rs | 20 +++++++++++++++ .../delegate_programmable_config_v1.rs | 20 +++++++++++++++ .../instructions/delegate_sale_v1.rs | 25 +++++++++++++++++++ .../instructions/delegate_staking_v1.rs | 25 +++++++++++++++++++ .../instructions/delegate_standard_v1.rs | 20 +++++++++++++++ .../instructions/delegate_transfer_v1.rs | 25 +++++++++++++++++++ .../instructions/delegate_utility_v1.rs | 25 +++++++++++++++++++ .../src/generated/instructions/lock_v1.rs | 25 +++++++++++++++++++ .../src/generated/instructions/migrate.rs | 5 ++++ .../src/generated/instructions/mint_v1.rs | 20 +++++++++++++++ .../instructions/revoke_authority_item_v1.rs | 20 +++++++++++++++ .../instructions/revoke_collection_item_v1.rs | 20 +++++++++++++++ .../instructions/revoke_collection_v1.rs | 20 +++++++++++++++ .../instructions/revoke_data_item_v1.rs | 20 +++++++++++++++ .../generated/instructions/revoke_data_v1.rs | 20 +++++++++++++++ .../instructions/revoke_locked_transfer_v1.rs | 25 +++++++++++++++++++ .../instructions/revoke_migration_v1.rs | 25 +++++++++++++++++++ .../revoke_programmable_config_item_v1.rs | 20 +++++++++++++++ .../revoke_programmable_config_v1.rs | 20 +++++++++++++++ .../generated/instructions/revoke_sale_v1.rs | 25 +++++++++++++++++++ .../instructions/revoke_staking_v1.rs | 25 +++++++++++++++++++ .../instructions/revoke_standard_v1.rs | 20 +++++++++++++++ .../instructions/revoke_transfer_v1.rs | 25 +++++++++++++++++++ .../instructions/revoke_utility_v1.rs | 25 +++++++++++++++++++ .../src/generated/instructions/transfer_v1.rs | 20 +++++++++++++++ .../src/generated/instructions/unlock_v1.rs | 25 +++++++++++++++++++ .../instructions/unverify_collection_v1.rs | 5 ++++ .../update_as_authority_item_delegate_v2.rs | 10 ++++++++ .../update_as_collection_delegate_v2.rs | 10 ++++++++ .../update_as_collection_item_delegate_v2.rs | 10 ++++++++ .../update_as_data_delegate_v2.rs | 10 ++++++++ .../update_as_data_item_delegate_v2.rs | 10 ++++++++ ...date_as_programmable_config_delegate_v2.rs | 10 ++++++++ ...as_programmable_config_item_delegate_v2.rs | 10 ++++++++ .../update_as_update_authority_v2.rs | 5 ++++ .../src/generated/instructions/update_v1.rs | 5 ++++ .../rust/src/generated/instructions/use_v1.rs | 5 ++++ .../instructions/verify_collection_v1.rs | 10 ++++++++ 46 files changed, 810 insertions(+) diff --git a/clients/rust/src/generated/instructions/burn_v1.rs b/clients/rust/src/generated/instructions/burn_v1.rs index 6f38640e..67ad65f9 100644 --- a/clients/rust/src/generated/instructions/burn_v1.rs +++ b/clients/rust/src/generated/instructions/burn_v1.rs @@ -373,6 +373,11 @@ impl<'a> BurnV1Cpi<'a> { *edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.mint.key, @@ -387,6 +392,11 @@ impl<'a> BurnV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(master_edition_mint) = self.master_edition_mint { accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -426,6 +436,11 @@ impl<'a> BurnV1Cpi<'a> { *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.system_program.key, diff --git a/clients/rust/src/generated/instructions/create_v1.rs b/clients/rust/src/generated/instructions/create_v1.rs index 3f4bec1e..525a61a1 100644 --- a/clients/rust/src/generated/instructions/create_v1.rs +++ b/clients/rust/src/generated/instructions/create_v1.rs @@ -374,6 +374,11 @@ impl<'a> CreateV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.mint.0.key, diff --git a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs index bb0bb184..0b3a0113 100644 --- a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs index ff343f23..6aa4fbbd 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_collection_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_v1.rs index 1b00c4db..82d41391 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateCollectionV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateCollectionV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateCollectionV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs index 40015d2f..0a3b3a44 100644 --- a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateDataItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateDataItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateDataItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_data_v1.rs b/clients/rust/src/generated/instructions/delegate_data_v1.rs index 00457a77..e660b3e4 100644 --- a/clients/rust/src/generated/instructions/delegate_data_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateDataV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateDataV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateDataV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs index 1d50f7ee..e42a3f02 100644 --- a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs @@ -371,6 +371,11 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -385,12 +390,22 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -421,12 +436,22 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs index c3cccc6e..399a86df 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs index d8da0ec4..8e18811a 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs @@ -351,6 +351,11 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -365,12 +370,22 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -418,6 +433,11 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_sale_v1.rs b/clients/rust/src/generated/instructions/delegate_sale_v1.rs index e3e217a1..7ce8737f 100644 --- a/clients/rust/src/generated/instructions/delegate_sale_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_sale_v1.rs @@ -353,6 +353,11 @@ impl<'a> DelegateSaleV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -367,12 +372,22 @@ impl<'a> DelegateSaleV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -403,12 +418,22 @@ impl<'a> DelegateSaleV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_staking_v1.rs b/clients/rust/src/generated/instructions/delegate_staking_v1.rs index a776e96f..8d5dfc56 100644 --- a/clients/rust/src/generated/instructions/delegate_staking_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_staking_v1.rs @@ -353,6 +353,11 @@ impl<'a> DelegateStakingV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -367,12 +372,22 @@ impl<'a> DelegateStakingV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -403,12 +418,22 @@ impl<'a> DelegateStakingV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_standard_v1.rs b/clients/rust/src/generated/instructions/delegate_standard_v1.rs index 175a8e29..d244ec5b 100644 --- a/clients/rust/src/generated/instructions/delegate_standard_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_standard_v1.rs @@ -345,6 +345,11 @@ impl<'a> DelegateStandardV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -359,6 +364,11 @@ impl<'a> DelegateStandardV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -400,12 +410,22 @@ impl<'a> DelegateStandardV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs index e59fff87..648ca3d8 100644 --- a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs @@ -353,6 +353,11 @@ impl<'a> DelegateTransferV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -367,12 +372,22 @@ impl<'a> DelegateTransferV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -403,12 +418,22 @@ impl<'a> DelegateTransferV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/delegate_utility_v1.rs b/clients/rust/src/generated/instructions/delegate_utility_v1.rs index efb74a67..68ceed82 100644 --- a/clients/rust/src/generated/instructions/delegate_utility_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_utility_v1.rs @@ -353,6 +353,11 @@ impl<'a> DelegateUtilityV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -367,12 +372,22 @@ impl<'a> DelegateUtilityV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -403,12 +418,22 @@ impl<'a> DelegateUtilityV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/lock_v1.rs b/clients/rust/src/generated/instructions/lock_v1.rs index fb20a8b8..04fd99ad 100644 --- a/clients/rust/src/generated/instructions/lock_v1.rs +++ b/clients/rust/src/generated/instructions/lock_v1.rs @@ -332,6 +332,11 @@ impl<'a> LockV1Cpi<'a> { *token_owner.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.token.key, @@ -350,12 +355,22 @@ impl<'a> LockV1Cpi<'a> { *edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.payer.key, @@ -374,12 +389,22 @@ impl<'a> LockV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/migrate.rs b/clients/rust/src/generated/instructions/migrate.rs index a8878b70..1c73b804 100644 --- a/clients/rust/src/generated/instructions/migrate.rs +++ b/clients/rust/src/generated/instructions/migrate.rs @@ -379,6 +379,11 @@ impl<'a> MigrateCpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/mint_v1.rs b/clients/rust/src/generated/instructions/mint_v1.rs index 6cc61ce3..fba27d77 100644 --- a/clients/rust/src/generated/instructions/mint_v1.rs +++ b/clients/rust/src/generated/instructions/mint_v1.rs @@ -378,6 +378,11 @@ impl<'a> MintV1Cpi<'a> { *token_owner.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.metadata.key, @@ -388,12 +393,22 @@ impl<'a> MintV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.mint.key, @@ -439,6 +454,11 @@ impl<'a> MintV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs index b8364cd2..e804416e 100644 --- a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs index 69b1aa5e..8f9dd9d7 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_collection_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_v1.rs index de8683bb..d739be78 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeCollectionV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeCollectionV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeCollectionV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs index 5a7967f7..5b71c8d5 100644 --- a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeDataItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeDataItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeDataItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_data_v1.rs b/clients/rust/src/generated/instructions/revoke_data_v1.rs index b02ef50e..59f8b920 100644 --- a/clients/rust/src/generated/instructions/revoke_data_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeDataV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeDataV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeDataV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs index 92be9151..e610db9c 100644 --- a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,12 +357,22 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -388,12 +403,22 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_migration_v1.rs b/clients/rust/src/generated/instructions/revoke_migration_v1.rs index 01990d4f..fe8ba090 100644 --- a/clients/rust/src/generated/instructions/revoke_migration_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_migration_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeMigrationV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,12 +357,22 @@ impl<'a> RevokeMigrationV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -388,12 +403,22 @@ impl<'a> RevokeMigrationV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs index 9b047783..6304ba36 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs index c9595072..630eba03 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs @@ -343,6 +343,11 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -357,12 +362,22 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -410,6 +425,11 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_sale_v1.rs b/clients/rust/src/generated/instructions/revoke_sale_v1.rs index 7a9e7ad2..fa87e869 100644 --- a/clients/rust/src/generated/instructions/revoke_sale_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_sale_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeSaleV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,12 +357,22 @@ impl<'a> RevokeSaleV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -388,12 +403,22 @@ impl<'a> RevokeSaleV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_staking_v1.rs b/clients/rust/src/generated/instructions/revoke_staking_v1.rs index 3680f6dd..76fb340d 100644 --- a/clients/rust/src/generated/instructions/revoke_staking_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_staking_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeStakingV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,12 +357,22 @@ impl<'a> RevokeStakingV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -388,12 +403,22 @@ impl<'a> RevokeStakingV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_standard_v1.rs b/clients/rust/src/generated/instructions/revoke_standard_v1.rs index 44abed77..f2b8ce9b 100644 --- a/clients/rust/src/generated/instructions/revoke_standard_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_standard_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeStandardV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,6 +357,11 @@ impl<'a> RevokeStandardV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -393,12 +403,22 @@ impl<'a> RevokeStandardV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs index 5dd642d8..9cdb21af 100644 --- a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeTransferV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,12 +357,22 @@ impl<'a> RevokeTransferV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -388,12 +403,22 @@ impl<'a> RevokeTransferV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/revoke_utility_v1.rs b/clients/rust/src/generated/instructions/revoke_utility_v1.rs index b5a3567f..3fd403e3 100644 --- a/clients/rust/src/generated/instructions/revoke_utility_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_utility_v1.rs @@ -338,6 +338,11 @@ impl<'a> RevokeUtilityV1Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.delegate.key, @@ -352,12 +357,22 @@ impl<'a> RevokeUtilityV1Cpi<'a> { *master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.mint.key, @@ -388,12 +403,22 @@ impl<'a> RevokeUtilityV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/transfer_v1.rs b/clients/rust/src/generated/instructions/transfer_v1.rs index 6c26c6e8..1ae7a3bf 100644 --- a/clients/rust/src/generated/instructions/transfer_v1.rs +++ b/clients/rust/src/generated/instructions/transfer_v1.rs @@ -428,18 +428,33 @@ impl<'a> TransferV1Cpi<'a> { *edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(destination_token_record) = self.destination_token_record { accounts.push(solana_program::instruction::AccountMeta::new( *destination_token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -470,6 +485,11 @@ impl<'a> TransferV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/unlock_v1.rs b/clients/rust/src/generated/instructions/unlock_v1.rs index 86e1d34e..c3e16f33 100644 --- a/clients/rust/src/generated/instructions/unlock_v1.rs +++ b/clients/rust/src/generated/instructions/unlock_v1.rs @@ -332,6 +332,11 @@ impl<'a> UnlockV1Cpi<'a> { *token_owner.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.token.key, @@ -350,12 +355,22 @@ impl<'a> UnlockV1Cpi<'a> { *edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token_record) = self.token_record { accounts.push(solana_program::instruction::AccountMeta::new( *token_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new( *self.payer.key, @@ -374,12 +389,22 @@ impl<'a> UnlockV1Cpi<'a> { *spl_token_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules_program) = self.authorization_rules_program { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/unverify_collection_v1.rs b/clients/rust/src/generated/instructions/unverify_collection_v1.rs index 1b9ef1ab..a24883b3 100644 --- a/clients/rust/src/generated/instructions/unverify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_collection_v1.rs @@ -235,6 +235,11 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { *collection_metadata.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.system_program.key, diff --git a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs index 6d4f0f53..5d3b6b53 100644 --- a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs @@ -327,6 +327,11 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token) = self.token { accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -374,6 +379,11 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs index ff256ed9..87a0c62e 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs @@ -305,6 +305,11 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token) = self.token { accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -352,6 +357,11 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs index 3860b7f9..97196dc1 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs @@ -305,6 +305,11 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token) = self.token { accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -352,6 +357,11 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs index 64ebd1ae..d06bccd6 100644 --- a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs @@ -314,6 +314,11 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token) = self.token { accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -361,6 +366,11 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs index bf728bac..0ccc1a3d 100644 --- a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs @@ -314,6 +314,11 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(token) = self.token { accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -361,6 +366,11 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs index b6ddc132..39640980 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs @@ -298,6 +298,11 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.token.key, @@ -339,6 +344,11 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs index 0c088aa1..f5e86778 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs @@ -298,6 +298,11 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { *delegate_record.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.token.key, @@ -339,6 +344,11 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs index cacd4b1d..2d696ba6 100644 --- a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs @@ -428,6 +428,11 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/update_v1.rs b/clients/rust/src/generated/instructions/update_v1.rs index 67b8c2cf..9a68d372 100644 --- a/clients/rust/src/generated/instructions/update_v1.rs +++ b/clients/rust/src/generated/instructions/update_v1.rs @@ -420,6 +420,11 @@ impl<'a> UpdateV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/use_v1.rs b/clients/rust/src/generated/instructions/use_v1.rs index 288d14c2..4742e1ed 100644 --- a/clients/rust/src/generated/instructions/use_v1.rs +++ b/clients/rust/src/generated/instructions/use_v1.rs @@ -382,6 +382,11 @@ impl<'a> UseV1Cpi<'a> { *authorization_rules_program.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(authorization_rules) = self.authorization_rules { accounts.push(solana_program::instruction::AccountMeta::new_readonly( diff --git a/clients/rust/src/generated/instructions/verify_collection_v1.rs b/clients/rust/src/generated/instructions/verify_collection_v1.rs index f4f5dda3..ec4bb06a 100644 --- a/clients/rust/src/generated/instructions/verify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/verify_collection_v1.rs @@ -259,12 +259,22 @@ impl<'a> VerifyCollectionV1Cpi<'a> { *collection_metadata.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } if let Some(collection_master_edition) = self.collection_master_edition { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *collection_master_edition.key, false, )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_TOKEN_METADATA_ID, + false, + )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.system_program.key, From 861e9ad2ba5e84c63c0128691bc433a66f5fb797 Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 18 Aug 2023 21:59:59 +0300 Subject: [PATCH 03/31] Update kinobi release --- package.json | 5 +++-- pnpm-lock.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 210d0afe..45e41caa 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "programs:test": "RUST_LOG=error ./configs/program-scripts/test.sh", "programs:debug": "./configs/program-scripts/test.sh", "programs:clean": "rm -rf ./programs/.bin", + "programs:sdk": "./configs/program-scripts/sdk.sh", "generate": "pnpm generate:idls && pnpm generate:clients", "generate:idls": "node ./configs/shank.cjs", "generate:clients": "node ./configs/kinobi.cjs", @@ -14,9 +15,9 @@ "validator:stop": "amman stop" }, "devDependencies": { - "@metaplex-foundation/kinobi": "^0.11.1", - "@metaplex-foundation/shank-js": "^0.1.0", "@metaplex-foundation/amman": "^0.12.1", + "@metaplex-foundation/kinobi": "^0.13.0", + "@metaplex-foundation/shank-js": "^0.1.0", "typescript": "^4.9.4" }, "packageManager": "pnpm@8.2.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74752407..1d7119e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,8 +5,8 @@ devDependencies: specifier: ^0.12.1 version: 0.12.1(typescript@4.9.5) '@metaplex-foundation/kinobi': - specifier: ^0.11.1 - version: 0.11.1 + specifier: ^0.13.0 + version: 0.13.0 '@metaplex-foundation/shank-js': specifier: ^0.1.0 version: 0.1.0 @@ -85,8 +85,8 @@ packages: resolution: {integrity: sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA==} dev: true - /@metaplex-foundation/kinobi@0.11.1: - resolution: {integrity: sha512-khRJA/2I9Capfj9vMrsPTFOTHWN9H1YPv8EOyELXgLkLRVlVZH0z88Ge/zzl2JqCTZpz1IOWJU1XfJYwiDamjQ==} + /@metaplex-foundation/kinobi@0.13.0: + resolution: {integrity: sha512-jAP4Cm7XVujV+MNGvXc0/xDR7yFxbP7vXivwRVQIxhHG/BGc3lJOCdv2pk3+GB0ZZh+2bLO0NkiCjdcu5oUFXQ==} dependencies: '@noble/hashes': 1.2.0 chalk: 4.1.2 From 225963b39075c575e04b53505384c9d30d11bbb1 Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 18 Aug 2023 22:00:44 +0300 Subject: [PATCH 04/31] Update generated code --- .../src/generated/accounts/editionMarkerV2.ts | 5 +- .../approveCollectionAuthority.ts | 8 +- .../instructions/approveUseAuthority.ts | 8 +- .../bubblegumSetCollectionSize.ts | 15 +- .../js/src/generated/instructions/burnNft.ts | 10 +- .../instructions/createEscrowAccount.ts | 10 +- .../instructions/createMasterEditionV3.ts | 8 +- .../instructions/createMetadataAccountV3.ts | 8 +- ...ditionFromMasterEditionViaPrintingToken.ts | 10 +- ...mintNewEditionFromMasterEditionViaToken.ts | 8 +- ...ewEditionFromMasterEditionViaVaultProxy.ts | 8 +- .../instructions/revokeUseAuthority.ts | 8 +- .../instructions/setAndVerifyCollection.ts | 13 +- .../setAndVerifySizedCollectionItem.ts | 13 +- .../instructions/setCollectionSize.ts | 15 +- .../instructions/setTokenStandard.ts | 10 +- .../instructions/transferOutOfEscrow.ts | 10 +- .../instructions/unverifyCollection.ts | 15 +- .../unverifySizedCollectionItem.ts | 13 +- .../js/src/generated/instructions/utilize.ts | 20 +- .../instructions/verifyCollection.ts | 13 +- .../instructions/verifySizedCollectionItem.ts | 13 +- clients/js/src/generated/types/seedsVec.ts | 3 +- .../accounts/collection_authority_record.rs | 11 + .../rust/src/generated/accounts/edition.rs | 11 + .../src/generated/accounts/edition_marker.rs | 11 + .../generated/accounts/edition_marker_v2.rs | 11 + .../src/generated/accounts/master_edition.rs | 11 + .../rust/src/generated/accounts/metadata.rs | 11 + .../accounts/metadata_delegate_record.rs | 11 + .../generated/accounts/token_owned_escrow.rs | 11 + .../src/generated/accounts/token_record.rs | 11 + .../accounts/use_authority_record.rs | 11 + .../generated/errors/mpl_token_metadata.rs | 195 +++++++++--------- .../approve_collection_authority.rs | 34 +++ .../instructions/approve_use_authority.rs | 48 +++++ .../bubblegum_set_collection_size.rs | 24 +++ .../instructions/burn_edition_nft.rs | 40 ++++ .../src/generated/instructions/burn_nft.rs | 30 +++ .../src/generated/instructions/burn_v1.rs | 72 +++++++ .../instructions/close_escrow_account.rs | 32 +++ .../src/generated/instructions/collect.rs | 8 + .../convert_master_edition_v1_to_v2.rs | 12 ++ .../instructions/create_escrow_account.rs | 38 ++++ .../instructions/create_master_edition_v3.rs | 42 ++++ .../create_metadata_account_v3.rs | 38 ++++ .../src/generated/instructions/create_v1.rs | 80 +++++++ .../delegate_authority_item_v1.rs | 74 +++++++ .../delegate_collection_item_v1.rs | 74 +++++++ .../instructions/delegate_collection_v1.rs | 74 +++++++ .../instructions/delegate_data_item_v1.rs | 74 +++++++ .../instructions/delegate_data_v1.rs | 74 +++++++ .../delegate_locked_transfer_v1.rs | 76 +++++++ .../delegate_programmable_config_item_v1.rs | 74 +++++++ .../delegate_programmable_config_v1.rs | 74 +++++++ .../instructions/delegate_sale_v1.rs | 74 +++++++ .../instructions/delegate_staking_v1.rs | 74 +++++++ .../instructions/delegate_standard_v1.rs | 70 +++++++ .../instructions/delegate_transfer_v1.rs | 74 +++++++ .../instructions/delegate_utility_v1.rs | 74 +++++++ ..._from_master_edition_via_printing_token.rs | 66 ++++++ .../instructions/freeze_delegated_account.rs | 20 ++ .../src/generated/instructions/lock_v1.rs | 68 ++++++ .../src/generated/instructions/migrate.rs | 64 ++++++ ...w_edition_from_master_edition_via_token.rs | 60 ++++++ ...ion_from_master_edition_via_vault_proxy.rs | 72 +++++++ .../src/generated/instructions/mint_v1.rs | 78 +++++++ .../src/generated/instructions/print_v1.rs | 76 +++++++ .../generated/instructions/puff_metadata.rs | 4 + .../remove_creator_verification.rs | 8 + .../instructions/revoke_authority_item_v1.rs | 70 +++++++ .../revoke_collection_authority.rs | 20 ++ .../instructions/revoke_collection_item_v1.rs | 70 +++++++ .../instructions/revoke_collection_v1.rs | 70 +++++++ .../instructions/revoke_data_item_v1.rs | 70 +++++++ .../generated/instructions/revoke_data_v1.rs | 70 +++++++ .../instructions/revoke_locked_transfer_v1.rs | 68 ++++++ .../instructions/revoke_migration_v1.rs | 68 ++++++ .../revoke_programmable_config_item_v1.rs | 70 +++++++ .../revoke_programmable_config_v1.rs | 70 +++++++ .../generated/instructions/revoke_sale_v1.rs | 68 ++++++ .../instructions/revoke_staking_v1.rs | 68 ++++++ .../instructions/revoke_standard_v1.rs | 68 ++++++ .../instructions/revoke_transfer_v1.rs | 68 ++++++ .../instructions/revoke_use_authority.rs | 38 ++++ .../instructions/revoke_utility_v1.rs | 68 ++++++ .../instructions/set_and_verify_collection.rs | 34 +++ .../set_and_verify_sized_collection_item.rs | 34 +++ .../instructions/set_collection_size.rs | 20 ++ .../instructions/set_token_standard.rs | 18 ++ .../generated/instructions/sign_metadata.rs | 8 + .../instructions/thaw_delegated_account.rs | 20 ++ .../instructions/transfer_out_of_escrow.rs | 56 +++++ .../src/generated/instructions/transfer_v1.rs | 84 ++++++++ .../src/generated/instructions/unlock_v1.rs | 68 ++++++ .../instructions/unverify_collection.rs | 26 +++ .../instructions/unverify_collection_v1.rs | 32 +++ .../instructions/unverify_creator_v1.rs | 34 +++ .../unverify_sized_collection_item.rs | 30 +++ .../update_as_authority_item_delegate_v2.rs | 74 +++++++ .../update_as_collection_delegate_v2.rs | 60 ++++++ .../update_as_collection_item_delegate_v2.rs | 60 ++++++ .../update_as_data_delegate_v2.rs | 62 ++++++ .../update_as_data_item_delegate_v2.rs | 62 ++++++ ...date_as_programmable_config_delegate_v2.rs | 58 ++++++ ...as_programmable_config_item_delegate_v2.rs | 58 ++++++ .../update_as_update_authority_v2.rs | 86 ++++++++ .../update_metadata_account_v2.rs | 24 +++ .../update_primary_sale_happened_via_token.rs | 12 ++ .../src/generated/instructions/update_v1.rs | 82 ++++++++ .../rust/src/generated/instructions/use_v1.rs | 64 ++++++ .../src/generated/instructions/utilize.rs | 50 +++++ .../instructions/verify_collection.rs | 30 +++ .../instructions/verify_collection_v1.rs | 38 ++++ .../instructions/verify_creator_v1.rs | 40 ++++ .../verify_sized_collection_item.rs | 30 +++ clients/rust/src/lib.rs | 2 +- 117 files changed, 4734 insertions(+), 169 deletions(-) diff --git a/clients/js/src/generated/accounts/editionMarkerV2.ts b/clients/js/src/generated/accounts/editionMarkerV2.ts index cdb4bd51..ea07c2b6 100644 --- a/clients/js/src/generated/accounts/editionMarkerV2.ts +++ b/clients/js/src/generated/accounts/editionMarkerV2.ts @@ -23,6 +23,7 @@ import { Serializer, bytes, struct, + u32, } from '@metaplex-foundation/umi/serializers'; import { Key, KeyArgs, getKeySerializer } from '../types'; @@ -49,7 +50,7 @@ export function getEditionMarkerV2AccountDataSerializer( return struct( [ ['key', getKeySerializer()], - ['ledger', bytes()], + ['ledger', bytes({ size: u32() })], ], { description: 'EditionMarkerV2AccountData' } ) as Serializer; @@ -139,7 +140,7 @@ export function getEditionMarkerV2GpaBuilder( return gpaBuilder(context, programId) .registerFields<{ key: KeyArgs; ledger: Uint8Array }>({ key: [0, getKeySerializer()], - ledger: [1, bytes()], + ledger: [1, bytes({ size: u32() })], }) .deserializeUsing((account) => deserializeEditionMarkerV2(account) diff --git a/clients/js/src/generated/instructions/approveCollectionAuthority.ts b/clients/js/src/generated/instructions/approveCollectionAuthority.ts index 2ab78cae..f3c5d5d4 100644 --- a/clients/js/src/generated/instructions/approveCollectionAuthority.ts +++ b/clients/js/src/generated/instructions/approveCollectionAuthority.ts @@ -104,7 +104,6 @@ export function approveCollectionAuthority( collectionAuthorityRecord: [input.collectionAuthorityRecord, true] as const, newCollectionAuthority: [input.newCollectionAuthority, false] as const, mint: [input.mint, false] as const, - rent: [input.rent, false] as const, }; addObjectProperty( resolvedAccounts, @@ -143,6 +142,11 @@ export function approveCollectionAuthority( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); addAccountMeta( keys, @@ -156,7 +160,7 @@ export function approveCollectionAuthority( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.mint, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/approveUseAuthority.ts b/clients/js/src/generated/instructions/approveUseAuthority.ts index c6d55311..86befd50 100644 --- a/clients/js/src/generated/instructions/approveUseAuthority.ts +++ b/clients/js/src/generated/instructions/approveUseAuthority.ts @@ -125,7 +125,6 @@ export function approveUseAuthority( ownerTokenAccount: [input.ownerTokenAccount, true] as const, mint: [input.mint, false] as const, burner: [input.burner, false] as const, - rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -171,6 +170,11 @@ export function approveUseAuthority( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, false); @@ -183,7 +187,7 @@ export function approveUseAuthority( addAccountMeta(keys, signers, resolvedAccounts.burner, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts index 0288df50..07cbc52e 100644 --- a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts +++ b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts @@ -21,7 +21,7 @@ import { struct, u8, } from '@metaplex-foundation/umi/serializers'; -import { addAccountMeta } from '../shared'; +import { addAccountMeta, addObjectProperty } from '../shared'; import { SetCollectionSizeArgs, SetCollectionSizeArgsArgs, @@ -113,12 +113,15 @@ export function bubblegumSetCollectionSize( collectionAuthority: [input.collectionAuthority, true] as const, collectionMint: [input.collectionMint, false] as const, bubblegumSigner: [input.bubblegumSigner, false] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; const resolvingArgs = {}; + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, false); @@ -129,7 +132,7 @@ export function bubblegumSetCollectionSize( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/burnNft.ts b/clients/js/src/generated/instructions/burnNft.ts index ff74bfab..de731796 100644 --- a/clients/js/src/generated/instructions/burnNft.ts +++ b/clients/js/src/generated/instructions/burnNft.ts @@ -87,7 +87,6 @@ export function burnNft( mint: [input.mint, true] as const, tokenAccount: [input.tokenAccount, true] as const, masterEditionAccount: [input.masterEditionAccount, true] as const, - collectionMetadata: [input.collectionMetadata, true] as const, }; addObjectProperty( resolvedAccounts, @@ -112,6 +111,13 @@ export function burnNft( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'collectionMetadata', + input.collectionMetadata + ? ([input.collectionMetadata, true] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.owner, false); @@ -119,7 +125,7 @@ export function burnNft( addAccountMeta(keys, signers, resolvedAccounts.tokenAccount, false); addAccountMeta(keys, signers, resolvedAccounts.masterEditionAccount, false); addAccountMeta(keys, signers, resolvedAccounts.splTokenProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, true); + addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, false); // Data. const data = getBurnNftInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/createEscrowAccount.ts b/clients/js/src/generated/instructions/createEscrowAccount.ts index f17d7d4f..c5246aa5 100644 --- a/clients/js/src/generated/instructions/createEscrowAccount.ts +++ b/clients/js/src/generated/instructions/createEscrowAccount.ts @@ -103,7 +103,6 @@ export function createEscrowAccount( escrow: [input.escrow, true] as const, mint: [input.mint, false] as const, tokenAccount: [input.tokenAccount, false] as const, - authority: [input.authority, false] as const, }; addObjectProperty( resolvedAccounts, @@ -155,6 +154,13 @@ export function createEscrowAccount( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'authority', + input.authority + ? ([input.authority, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.escrow, false); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); @@ -164,7 +170,7 @@ export function createEscrowAccount( addAccountMeta(keys, signers, resolvedAccounts.payer, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); addAccountMeta(keys, signers, resolvedAccounts.sysvarInstructions, false); - addAccountMeta(keys, signers, resolvedAccounts.authority, true); + addAccountMeta(keys, signers, resolvedAccounts.authority, false); // Data. const data = getCreateEscrowAccountInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/createMasterEditionV3.ts b/clients/js/src/generated/instructions/createMasterEditionV3.ts index 303dfd31..154023ea 100644 --- a/clients/js/src/generated/instructions/createMasterEditionV3.ts +++ b/clients/js/src/generated/instructions/createMasterEditionV3.ts @@ -120,7 +120,6 @@ export function createMasterEditionV3( const resolvedAccounts = { mint: [input.mint, true] as const, mintAuthority: [input.mintAuthority, false] as const, - rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -183,6 +182,11 @@ export function createMasterEditionV3( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.edition, false); @@ -193,7 +197,7 @@ export function createMasterEditionV3( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/createMetadataAccountV3.ts b/clients/js/src/generated/instructions/createMetadataAccountV3.ts index f984fae8..8f4e2198 100644 --- a/clients/js/src/generated/instructions/createMetadataAccountV3.ts +++ b/clients/js/src/generated/instructions/createMetadataAccountV3.ts @@ -130,7 +130,6 @@ export function createMetadataAccountV3( const resolvedAccounts = { mint: [input.mint, false] as const, mintAuthority: [input.mintAuthority, false] as const, - rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -170,6 +169,11 @@ export function createMetadataAccountV3( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.metadata, false); @@ -178,7 +182,7 @@ export function createMetadataAccountV3( addAccountMeta(keys, signers, resolvedAccounts.payer, false); addAccountMeta(keys, signers, resolvedAccounts.updateAuthority, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts index 1e116e7e..3204d5af 100644 --- a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts +++ b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts @@ -128,7 +128,6 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( burnAuthority: [input.burnAuthority, false] as const, masterUpdateAuthority: [input.masterUpdateAuthority, false] as const, masterMetadata: [input.masterMetadata, false] as const, - reservationList: [input.reservationList, true] as const, }; addObjectProperty( resolvedAccounts, @@ -213,6 +212,13 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'reservationList', + input.reservationList + ? ([input.reservationList, true] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.edition, false); @@ -229,7 +235,7 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); addAccountMeta(keys, signers, resolvedAccounts.rent, false); - addAccountMeta(keys, signers, resolvedAccounts.reservationList, true); + addAccountMeta(keys, signers, resolvedAccounts.reservationList, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts index c7b0a481..1f1cf719 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts @@ -143,7 +143,6 @@ export function mintNewEditionFromMasterEditionViaToken( false, ] as const, metadata: [input.metadata, false] as const, - rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -179,6 +178,11 @@ export function mintNewEditionFromMasterEditionViaToken( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.newMetadata, false); @@ -199,7 +203,7 @@ export function mintNewEditionFromMasterEditionViaToken( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts index 6151c328..37ddf9b4 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts @@ -155,7 +155,6 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( ] as const, metadata: [input.metadata, false] as const, tokenVaultProgram: [input.tokenVaultProgram, false] as const, - rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -191,6 +190,11 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.newMetadata, false); @@ -214,7 +218,7 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.tokenVaultProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/revokeUseAuthority.ts b/clients/js/src/generated/instructions/revokeUseAuthority.ts index ac38e34e..01d44a8d 100644 --- a/clients/js/src/generated/instructions/revokeUseAuthority.ts +++ b/clients/js/src/generated/instructions/revokeUseAuthority.ts @@ -105,7 +105,6 @@ export function revokeUseAuthority( user: [input.user, false] as const, ownerTokenAccount: [input.ownerTokenAccount, true] as const, mint: [input.mint, false] as const, - rent: [input.rent, false] as const, }; addObjectProperty( resolvedAccounts, @@ -143,6 +142,11 @@ export function revokeUseAuthority( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'rent', + input.rent ? ([input.rent, false] as const) : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, false); addAccountMeta(keys, signers, resolvedAccounts.owner, false); @@ -152,7 +156,7 @@ export function revokeUseAuthority( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, true); + addAccountMeta(keys, signers, resolvedAccounts.rent, false); // Data. const data = getRevokeUseAuthorityInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/setAndVerifyCollection.ts b/clients/js/src/generated/instructions/setAndVerifyCollection.ts index f831e711..c88c2cdc 100644 --- a/clients/js/src/generated/instructions/setAndVerifyCollection.ts +++ b/clients/js/src/generated/instructions/setAndVerifyCollection.ts @@ -104,10 +104,6 @@ export function setAndVerifyCollection( input.collectionMasterEditionAccount, false, ] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; addObjectProperty( resolvedAccounts, @@ -123,6 +119,13 @@ export function setAndVerifyCollection( ? ([input.updateAuthority, false] as const) : ([context.identity.publicKey, false] as const) ); + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -140,7 +143,7 @@ export function setAndVerifyCollection( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts index d29d8711..97e21082 100644 --- a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts @@ -107,10 +107,6 @@ export function setAndVerifySizedCollectionItem( input.collectionMasterEditionAccount, true, ] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; addObjectProperty( resolvedAccounts, @@ -126,6 +122,13 @@ export function setAndVerifySizedCollectionItem( ? ([input.updateAuthority, false] as const) : ([context.identity.publicKey, false] as const) ); + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -143,7 +146,7 @@ export function setAndVerifySizedCollectionItem( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/setCollectionSize.ts b/clients/js/src/generated/instructions/setCollectionSize.ts index 91dd922b..d14de9b7 100644 --- a/clients/js/src/generated/instructions/setCollectionSize.ts +++ b/clients/js/src/generated/instructions/setCollectionSize.ts @@ -21,7 +21,7 @@ import { struct, u8, } from '@metaplex-foundation/umi/serializers'; -import { addAccountMeta } from '../shared'; +import { addAccountMeta, addObjectProperty } from '../shared'; import { SetCollectionSizeArgs, SetCollectionSizeArgsArgs, @@ -109,12 +109,15 @@ export function setCollectionSize( collectionMetadata: [input.collectionMetadata, true] as const, collectionAuthority: [input.collectionAuthority, true] as const, collectionMint: [input.collectionMint, false] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; const resolvingArgs = {}; + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, false); @@ -124,7 +127,7 @@ export function setCollectionSize( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/setTokenStandard.ts b/clients/js/src/generated/instructions/setTokenStandard.ts index 090b1385..cd5952dd 100644 --- a/clients/js/src/generated/instructions/setTokenStandard.ts +++ b/clients/js/src/generated/instructions/setTokenStandard.ts @@ -91,7 +91,6 @@ export function setTokenStandard( // Resolved inputs. const resolvedAccounts = { mint: [input.mint, false] as const, - edition: [input.edition, false] as const, }; addObjectProperty( resolvedAccounts, @@ -110,11 +109,18 @@ export function setTokenStandard( ? ([input.updateAuthority, false] as const) : ([context.identity, false] as const) ); + addObjectProperty( + resolvedAccounts, + 'edition', + input.edition + ? ([input.edition, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.updateAuthority, false); addAccountMeta(keys, signers, resolvedAccounts.mint, false); - addAccountMeta(keys, signers, resolvedAccounts.edition, true); + addAccountMeta(keys, signers, resolvedAccounts.edition, false); // Data. const data = getSetTokenStandardInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/transferOutOfEscrow.ts b/clients/js/src/generated/instructions/transferOutOfEscrow.ts index c8933412..81fe6817 100644 --- a/clients/js/src/generated/instructions/transferOutOfEscrow.ts +++ b/clients/js/src/generated/instructions/transferOutOfEscrow.ts @@ -129,7 +129,6 @@ export function transferOutOfEscrow( attributeDst: [input.attributeDst, true] as const, escrowMint: [input.escrowMint, false] as const, escrowAccount: [input.escrowAccount, false] as const, - authority: [input.authority, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -188,6 +187,13 @@ export function transferOutOfEscrow( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'authority', + input.authority + ? ([input.authority, false] as const) + : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.escrow, false); @@ -202,7 +208,7 @@ export function transferOutOfEscrow( addAccountMeta(keys, signers, resolvedAccounts.ataProgram, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.sysvarInstructions, false); - addAccountMeta(keys, signers, resolvedAccounts.authority, true); + addAccountMeta(keys, signers, resolvedAccounts.authority, false); // Data. const data = diff --git a/clients/js/src/generated/instructions/unverifyCollection.ts b/clients/js/src/generated/instructions/unverifyCollection.ts index 0ade7b9d..64cff44e 100644 --- a/clients/js/src/generated/instructions/unverifyCollection.ts +++ b/clients/js/src/generated/instructions/unverifyCollection.ts @@ -21,7 +21,7 @@ import { struct, u8, } from '@metaplex-foundation/umi/serializers'; -import { addAccountMeta } from '../shared'; +import { addAccountMeta, addObjectProperty } from '../shared'; // Accounts. export type UnverifyCollectionInstructionAccounts = { @@ -100,11 +100,14 @@ export function unverifyCollection( input.collectionMasterEditionAccount, false, ] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -120,7 +123,7 @@ export function unverifyCollection( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts index 571e4839..17501bb7 100644 --- a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts @@ -105,10 +105,6 @@ export function unverifySizedCollectionItem( input.collectionMasterEditionAccount, false, ] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; addObjectProperty( resolvedAccounts, @@ -117,6 +113,13 @@ export function unverifySizedCollectionItem( ? ([input.payer, true] as const) : ([context.payer, true] as const) ); + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -133,7 +136,7 @@ export function unverifySizedCollectionItem( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/utilize.ts b/clients/js/src/generated/instructions/utilize.ts index 30fb6f0b..d860e579 100644 --- a/clients/js/src/generated/instructions/utilize.ts +++ b/clients/js/src/generated/instructions/utilize.ts @@ -106,8 +106,6 @@ export function utilize( mint: [input.mint, true] as const, useAuthority: [input.useAuthority, true] as const, owner: [input.owner, false] as const, - useAuthorityRecord: [input.useAuthorityRecord, true] as const, - burner: [input.burner, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -169,6 +167,20 @@ export function utilize( false, ] as const) ); + addObjectProperty( + resolvedAccounts, + 'useAuthorityRecord', + input.useAuthorityRecord + ? ([input.useAuthorityRecord, true] as const) + : ([programId, false] as const) + ); + addObjectProperty( + resolvedAccounts, + 'burner', + input.burner + ? ([input.burner, false] as const) + : ([programId, false] as const) + ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.metadata, false); @@ -180,8 +192,8 @@ export function utilize( addAccountMeta(keys, signers, resolvedAccounts.ataProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); addAccountMeta(keys, signers, resolvedAccounts.rent, false); - addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, true); - addAccountMeta(keys, signers, resolvedAccounts.burner, true); + addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, false); + addAccountMeta(keys, signers, resolvedAccounts.burner, false); // Data. const data = getUtilizeInstructionDataSerializer().serialize(resolvedArgs); diff --git a/clients/js/src/generated/instructions/verifyCollection.ts b/clients/js/src/generated/instructions/verifyCollection.ts index 4abb001a..eb522b93 100644 --- a/clients/js/src/generated/instructions/verifyCollection.ts +++ b/clients/js/src/generated/instructions/verifyCollection.ts @@ -102,10 +102,6 @@ export function verifyCollection( input.collectionMasterEditionAccount, false, ] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; addObjectProperty( resolvedAccounts, @@ -114,6 +110,13 @@ export function verifyCollection( ? ([input.payer, true] as const) : ([context.payer, true] as const) ); + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -130,7 +133,7 @@ export function verifyCollection( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts index 9a62eb6a..f1248441 100644 --- a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts @@ -105,10 +105,6 @@ export function verifySizedCollectionItem( input.collectionMasterEditionAccount, false, ] as const, - collectionAuthorityRecord: [ - input.collectionAuthorityRecord, - false, - ] as const, }; addObjectProperty( resolvedAccounts, @@ -117,6 +113,13 @@ export function verifySizedCollectionItem( ? ([input.payer, true] as const) : ([context.payer, true] as const) ); + addObjectProperty( + resolvedAccounts, + 'collectionAuthorityRecord', + input.collectionAuthorityRecord + ? ([input.collectionAuthorityRecord, false] as const) + : ([programId, false] as const) + ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -133,7 +136,7 @@ export function verifySizedCollectionItem( keys, signers, resolvedAccounts.collectionAuthorityRecord, - true + false ); // Data. diff --git a/clients/js/src/generated/types/seedsVec.ts b/clients/js/src/generated/types/seedsVec.ts index 3aec4b3d..bc483fbf 100644 --- a/clients/js/src/generated/types/seedsVec.ts +++ b/clients/js/src/generated/types/seedsVec.ts @@ -11,6 +11,7 @@ import { array, bytes, struct, + u32, } from '@metaplex-foundation/umi/serializers'; export type SeedsVec = { seeds: Array }; @@ -25,7 +26,7 @@ export function getSeedsVecSerializer(): Serializer; export function getSeedsVecSerializer( _context: object = {} ): Serializer { - return struct([['seeds', array(bytes())]], { + return struct([['seeds', array(bytes({ size: u32() }))]], { description: 'SeedsVec', }) as Serializer; } diff --git a/clients/rust/src/generated/accounts/collection_authority_record.rs b/clients/rust/src/generated/accounts/collection_authority_record.rs index 3a69864c..657840e8 100644 --- a/clients/rust/src/generated/accounts/collection_authority_record.rs +++ b/clients/rust/src/generated/accounts/collection_authority_record.rs @@ -51,3 +51,14 @@ impl CollectionAuthorityRecord { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for CollectionAuthorityRecord { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/edition.rs b/clients/rust/src/generated/accounts/edition.rs index 8b089cd6..87853288 100644 --- a/clients/rust/src/generated/accounts/edition.rs +++ b/clients/rust/src/generated/accounts/edition.rs @@ -20,3 +20,14 @@ pub struct Edition { impl Edition { pub const LEN: usize = 41; } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for Edition { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/edition_marker.rs b/clients/rust/src/generated/accounts/edition_marker.rs index d8dfba47..1f7f5b93 100644 --- a/clients/rust/src/generated/accounts/edition_marker.rs +++ b/clients/rust/src/generated/accounts/edition_marker.rs @@ -49,3 +49,14 @@ impl EditionMarker { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for EditionMarker { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/edition_marker_v2.rs b/clients/rust/src/generated/accounts/edition_marker_v2.rs index c5e40ebf..0110de99 100644 --- a/clients/rust/src/generated/accounts/edition_marker_v2.rs +++ b/clients/rust/src/generated/accounts/edition_marker_v2.rs @@ -14,3 +14,14 @@ pub struct EditionMarkerV2 { pub key: Key, pub ledger: Vec, } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for EditionMarkerV2 { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/master_edition.rs b/clients/rust/src/generated/accounts/master_edition.rs index ea4242a0..6cc68b4d 100644 --- a/clients/rust/src/generated/accounts/master_edition.rs +++ b/clients/rust/src/generated/accounts/master_edition.rs @@ -47,3 +47,14 @@ impl MasterEdition { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for MasterEdition { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/metadata.rs b/clients/rust/src/generated/accounts/metadata.rs index f5a48b74..ce9ab4f7 100644 --- a/clients/rust/src/generated/accounts/metadata.rs +++ b/clients/rust/src/generated/accounts/metadata.rs @@ -64,3 +64,14 @@ impl Metadata { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for Metadata { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs index db332899..17c61b50 100644 --- a/clients/rust/src/generated/accounts/metadata_delegate_record.rs +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -62,3 +62,14 @@ impl MetadataDelegateRecord { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for MetadataDelegateRecord { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/token_owned_escrow.rs b/clients/rust/src/generated/accounts/token_owned_escrow.rs index 478dd786..f15a6c0b 100644 --- a/clients/rust/src/generated/accounts/token_owned_escrow.rs +++ b/clients/rust/src/generated/accounts/token_owned_escrow.rs @@ -18,3 +18,14 @@ pub struct TokenOwnedEscrow { pub authority: EscrowAuthority, pub bump: u8, } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for TokenOwnedEscrow { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs index 3186a7a1..7840e082 100644 --- a/clients/rust/src/generated/accounts/token_record.rs +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -56,3 +56,14 @@ impl TokenRecord { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for TokenRecord { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/use_authority_record.rs b/clients/rust/src/generated/accounts/use_authority_record.rs index 7876085e..2a514bce 100644 --- a/clients/rust/src/generated/accounts/use_authority_record.rs +++ b/clients/rust/src/generated/accounts/use_authority_record.rs @@ -50,3 +50,14 @@ impl UseAuthorityRecord { ) } } + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for UseAuthorityRecord { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/errors/mpl_token_metadata.rs b/clients/rust/src/generated/errors/mpl_token_metadata.rs index 8f2f7fbc..e83b0d09 100644 --- a/clients/rust/src/generated/errors/mpl_token_metadata.rs +++ b/clients/rust/src/generated/errors/mpl_token_metadata.rs @@ -5,9 +5,10 @@ //! [https://github.com/metaplex-foundation/kinobi] //! +use num_derive::FromPrimitive; use thiserror::Error; -#[derive(Clone, Debug, Eq, Error, PartialEq)] +#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)] pub enum MplTokenMetadataError { /// 0x0 - #[error("")] @@ -39,22 +40,22 @@ pub enum MplTokenMetadataError { /// 0x9 - You must be the mint authority and signer on this transaction #[error("You must be the mint authority and signer on this transaction")] NotMintAuthority, - /// 0xa - Mint authority provided does not match the authority on the mint + /// 0xA - Mint authority provided does not match the authority on the mint #[error("Mint authority provided does not match the authority on the mint")] InvalidMintAuthority, - /// 0xb - Name too long + /// 0xB - Name too long #[error("Name too long")] NameTooLong, - /// 0xc - Symbol too long + /// 0xC - Symbol too long #[error("Symbol too long")] SymbolTooLong, - /// 0xd - URI too long + /// 0xD - URI too long #[error("URI too long")] UriTooLong, - /// 0xe - + /// 0xE - #[error("")] UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner, - /// 0xf - Mint given does not match mint on Metadata + /// 0xF - Mint given does not match mint on Metadata #[error("Mint given does not match mint on Metadata")] MintMismatch, /// 0x10 - Editions must have exactly one token @@ -87,22 +88,22 @@ pub enum MplTokenMetadataError { /// 0x19 - #[error("")] TokenBurnFailed, - /// 0x1a - + /// 0x1A - #[error("")] TokenAccountOneTimeAuthMintMismatch, - /// 0x1b - Derived key invalid + /// 0x1B - Derived key invalid #[error("Derived key invalid")] DerivedKeyInvalid, - /// 0x1c - The Printing mint does not match that on the master edition! + /// 0x1C - The Printing mint does not match that on the master edition! #[error("The Printing mint does not match that on the master edition!")] PrintingMintMismatch, - /// 0x1d - The One Time Printing Auth mint does not match that on the master edition! + /// 0x1D - The One Time Printing Auth mint does not match that on the master edition! #[error("The One Time Printing Auth mint does not match that on the master edition!")] OneTimePrintingAuthMintMismatch, - /// 0x1e - The mint of the token account does not match the Printing mint! + /// 0x1E - The mint of the token account does not match the Printing mint! #[error("The mint of the token account does not match the Printing mint!")] TokenAccountMintMismatch, - /// 0x1f - The mint of the token account does not match the master metadata mint! + /// 0x1F - The mint of the token account does not match the master metadata mint! #[error("The mint of the token account does not match the master metadata mint!")] TokenAccountMintMismatchV2, /// 0x20 - Not enough tokens to mint a limited edition @@ -135,22 +136,22 @@ pub enum MplTokenMetadataError { /// 0x29 - Basis points cannot be more than 10000 #[error("Basis points cannot be more than 10000")] InvalidBasisPoints, - /// 0x2a - Primary sale can only be flipped to true and is immutable + /// 0x2A - Primary sale can only be flipped to true and is immutable #[error("Primary sale can only be flipped to true and is immutable")] PrimarySaleCanOnlyBeFlippedToTrue, - /// 0x2b - Owner does not match that on the account given + /// 0x2B - Owner does not match that on the account given #[error("Owner does not match that on the account given")] OwnerMismatch, - /// 0x2c - This account has no tokens to be used for authorization + /// 0x2C - This account has no tokens to be used for authorization #[error("This account has no tokens to be used for authorization")] NoBalanceInAccountForAuthorization, - /// 0x2d - Share total must equal 100 for creator array + /// 0x2D - Share total must equal 100 for creator array #[error("Share total must equal 100 for creator array")] ShareTotalMustBe100, - /// 0x2e - + /// 0x2E - #[error("")] ReservationExists, - /// 0x2f - + /// 0x2F - #[error("")] ReservationDoesNotExist, /// 0x30 - @@ -183,22 +184,22 @@ pub enum MplTokenMetadataError { /// 0x39 - Incorrect account owner #[error("Incorrect account owner")] IncorrectOwner, - /// 0x3a - + /// 0x3A - #[error("")] PrintingWouldBreachMaximumSupply, - /// 0x3b - Data is immutable + /// 0x3B - Data is immutable #[error("Data is immutable")] DataIsImmutable, - /// 0x3c - No duplicate creator addresses + /// 0x3C - No duplicate creator addresses #[error("No duplicate creator addresses")] DuplicateCreatorAddress, - /// 0x3d - + /// 0x3D - #[error("")] ReservationSpotsRemainingShouldMatchTotalSpotsAtStart, - /// 0x3e - Invalid token program + /// 0x3E - Invalid token program #[error("Invalid token program")] InvalidTokenProgram, - /// 0x3f - Data type mismatch + /// 0x3F - Data type mismatch #[error("Data type mismatch")] DataTypeMismatch, /// 0x40 - @@ -231,22 +232,22 @@ pub enum MplTokenMetadataError { /// 0x49 - Is Mutable can only be flipped to false #[error("Is Mutable can only be flipped to false")] IsMutableCanOnlyBeFlippedToFalse, - /// 0x4a - Collection cannot be verified in this instruction + /// 0x4A - Collection cannot be verified in this instruction #[error("Collection cannot be verified in this instruction")] CollectionCannotBeVerifiedInThisInstruction, - /// 0x4b - This instruction was deprecated in a previous release and is now removed + /// 0x4B - This instruction was deprecated in a previous release and is now removed #[error("This instruction was deprecated in a previous release and is now removed")] Removed, - /// 0x4c - + /// 0x4C - #[error("")] MustBeBurned, - /// 0x4d - This use method is invalid + /// 0x4D - This use method is invalid #[error("This use method is invalid")] InvalidUseMethod, - /// 0x4e - Cannot Change Use Method after the first use + /// 0x4E - Cannot Change Use Method after the first use #[error("Cannot Change Use Method after the first use")] CannotChangeUseMethodAfterFirstUse, - /// 0x4f - Cannot Change Remaining or Available uses after the first use + /// 0x4F - Cannot Change Remaining or Available uses after the first use #[error("Cannot Change Remaining or Available uses after the first use")] CannotChangeUsesAfterFirstUse, /// 0x50 - Collection Not Found on Metadata @@ -279,22 +280,22 @@ pub enum MplTokenMetadataError { /// 0x59 - This Use Authority Record is invalid. #[error("This Use Authority Record is invalid.")] InvalidUseAuthorityRecord, - /// 0x5a - + /// 0x5A - #[error("")] InvalidCollectionAuthorityRecord, - /// 0x5b - Metadata does not match the freeze authority on the mint + /// 0x5B - Metadata does not match the freeze authority on the mint #[error("Metadata does not match the freeze authority on the mint")] InvalidFreezeAuthority, - /// 0x5c - All tokens in this account have not been delegated to this user. + /// 0x5C - All tokens in this account have not been delegated to this user. #[error("All tokens in this account have not been delegated to this user.")] InvalidDelegate, - /// 0x5d - + /// 0x5D - #[error("")] CannotAdjustVerifiedCreator, - /// 0x5e - Verified creators cannot be removed. + /// 0x5E - Verified creators cannot be removed. #[error("Verified creators cannot be removed.")] CannotRemoveVerifiedCreator, - /// 0x5f - + /// 0x5F - #[error("")] CannotWipeVerifiedCreators, /// 0x60 - @@ -327,22 +328,22 @@ pub enum MplTokenMetadataError { /// 0x69 - This NFT is not a verified member of the specified collection. #[error("This NFT is not a verified member of the specified collection.")] NotVerifiedMemberOfCollection, - /// 0x6a - This NFT is not a collection parent NFT. + /// 0x6A - This NFT is not a collection parent NFT. #[error("This NFT is not a collection parent NFT.")] NotACollectionParent, - /// 0x6b - Could not determine a TokenStandard type. + /// 0x6B - Could not determine a TokenStandard type. #[error("Could not determine a TokenStandard type.")] CouldNotDetermineTokenStandard, - /// 0x6c - This mint account has an edition but none was provided. + /// 0x6C - This mint account has an edition but none was provided. #[error("This mint account has an edition but none was provided.")] MissingEditionAccount, - /// 0x6d - This edition is not a Master Edition + /// 0x6D - This edition is not a Master Edition #[error("This edition is not a Master Edition")] NotAMasterEdition, - /// 0x6e - This Master Edition has existing prints + /// 0x6E - This Master Edition has existing prints #[error("This Master Edition has existing prints")] MasterEditionHasPrints, - /// 0x6f - + /// 0x6F - #[error("")] BorshDeserializationError, /// 0x70 - Cannot update a verified collection in this command @@ -375,22 +376,22 @@ pub enum MplTokenMetadataError { /// 0x79 - Print Edition does not match Master Edition #[error("Print Edition does not match Master Edition")] PrintEditionDoesNotMatchMasterEdition, - /// 0x7a - Edition Number greater than max supply + /// 0x7A - Edition Number greater than max supply #[error("Edition Number greater than max supply")] EditionNumberGreaterThanMaxSupply, - /// 0x7b - Must unverify before migrating collections. + /// 0x7B - Must unverify before migrating collections. #[error("Must unverify before migrating collections.")] MustUnverify, - /// 0x7c - Invalid Escrow Account Bump Seed + /// 0x7C - Invalid Escrow Account Bump Seed #[error("Invalid Escrow Account Bump Seed")] InvalidEscrowBumpSeed, - /// 0x7d - Must Escrow Authority + /// 0x7D - Must Escrow Authority #[error("Must Escrow Authority")] MustBeEscrowAuthority, - /// 0x7e - Invalid System Program + /// 0x7E - Invalid System Program #[error("Invalid System Program")] InvalidSystemProgram, - /// 0x7f - Must be a Non Fungible Token + /// 0x7F - Must be a Non Fungible Token #[error("Must be a Non Fungible Token")] MustBeNonFungible, /// 0x80 - Insufficient tokens for transfer @@ -423,22 +424,22 @@ pub enum MplTokenMetadataError { /// 0x89 - Invalid authorization rules account #[error("Invalid authorization rules account")] InvalidAuthorizationRules, - /// 0x8a - Missing authorization rules account + /// 0x8A - Missing authorization rules account #[error("Missing authorization rules account")] MissingAuthorizationRules, - /// 0x8b - Missing programmable configuration + /// 0x8B - Missing programmable configuration #[error("Missing programmable configuration")] MissingProgrammableConfig, - /// 0x8c - Invalid programmable configuration + /// 0x8C - Invalid programmable configuration #[error("Invalid programmable configuration")] InvalidProgrammableConfig, - /// 0x8d - Delegate already exists + /// 0x8D - Delegate already exists #[error("Delegate already exists")] DelegateAlreadyExists, - /// 0x8e - Delegate not found + /// 0x8E - Delegate not found #[error("Delegate not found")] DelegateNotFound, - /// 0x8f - Required account not set in instruction builder + /// 0x8F - Required account not set in instruction builder #[error("Required account not set in instruction builder")] MissingAccountInBuilder, /// 0x90 - Required argument not set in instruction builder @@ -471,121 +472,127 @@ pub enum MplTokenMetadataError { /// 0x99 - Instruction not supported for ProgrammableNonFungible assets #[error("Instruction not supported for ProgrammableNonFungible assets")] InstructionNotSupported, - /// 0x9a - Public key does not match expected value + /// 0x9A - Public key does not match expected value #[error("Public key does not match expected value")] KeyMismatch, - /// 0x9b - Token is locked + /// 0x9B - Token is locked #[error("Token is locked")] LockedToken, - /// 0x9c - Token is unlocked + /// 0x9C - Token is unlocked #[error("Token is unlocked")] UnlockedToken, - /// 0x9d - Missing delegate role + /// 0x9D - Missing delegate role #[error("Missing delegate role")] MissingDelegateRole, - /// 0x9e - Invalid authority type + /// 0x9E - Invalid authority type #[error("Invalid authority type")] InvalidAuthorityType, - /// 0x9f - Missing token record account + /// 0x9F - Missing token record account #[error("Missing token record account")] MissingTokenRecord, - /// 0xa0 - Mint supply must be zero for programmable assets + /// 0xA0 - Mint supply must be zero for programmable assets #[error("Mint supply must be zero for programmable assets")] MintSupplyMustBeZero, - /// 0xa1 - Data is empty or zeroed + /// 0xA1 - Data is empty or zeroed #[error("Data is empty or zeroed")] DataIsEmptyOrZeroed, - /// 0xa2 - Missing token owner + /// 0xA2 - Missing token owner #[error("Missing token owner")] MissingTokenOwnerAccount, - /// 0xa3 - Master edition account has an invalid length + /// 0xA3 - Master edition account has an invalid length #[error("Master edition account has an invalid length")] InvalidMasterEditionAccountLength, - /// 0xa4 - Incorrect token state + /// 0xA4 - Incorrect token state #[error("Incorrect token state")] IncorrectTokenState, - /// 0xa5 - Invalid delegate role + /// 0xA5 - Invalid delegate role #[error("Invalid delegate role")] InvalidDelegateRole, - /// 0xa6 - Print supply is required for non-fungibles + /// 0xA6 - Print supply is required for non-fungibles #[error("Print supply is required for non-fungibles")] MissingPrintSupply, - /// 0xa7 - Missing master edition account + /// 0xA7 - Missing master edition account #[error("Missing master edition account")] MissingMasterEditionAccount, - /// 0xa8 - Amount must be greater than zero + /// 0xA8 - Amount must be greater than zero #[error("Amount must be greater than zero")] AmountMustBeGreaterThanZero, - /// 0xa9 - Invalid delegate args + /// 0xA9 - Invalid delegate args #[error("Invalid delegate args")] InvalidDelegateArgs, - /// 0xaa - Missing address for locked transfer + /// 0xAA - Missing address for locked transfer #[error("Missing address for locked transfer")] MissingLockedTransferAddress, - /// 0xab - Invalid destination address for locked transfer + /// 0xAB - Invalid destination address for locked transfer #[error("Invalid destination address for locked transfer")] InvalidLockedTransferAddress, - /// 0xac - Exceeded account realloc increase limit + /// 0xAC - Exceeded account realloc increase limit #[error("Exceeded account realloc increase limit")] DataIncrementLimitExceeded, - /// 0xad - Cannot update the rule set of a programmable asset that has a delegate + /// 0xAD - Cannot update the rule set of a programmable asset that has a delegate #[error("Cannot update the rule set of a programmable asset that has a delegate")] CannotUpdateAssetWithDelegate, - /// 0xae - Invalid token amount for this operation or token standard + /// 0xAE - Invalid token amount for this operation or token standard #[error("Invalid token amount for this operation or token standard")] InvalidAmount, - /// 0xaf - Missing master edition mint account + /// 0xAF - Missing master edition mint account #[error("Missing master edition mint account")] MissingMasterEditionMintAccount, - /// 0xb0 - Missing master edition token account + /// 0xB0 - Missing master edition token account #[error("Missing master edition token account")] MissingMasterEditionTokenAccount, - /// 0xb1 - Missing edition marker account + /// 0xB1 - Missing edition marker account #[error("Missing edition marker account")] MissingEditionMarkerAccount, - /// 0xb2 - Cannot burn while persistent delegate is set + /// 0xB2 - Cannot burn while persistent delegate is set #[error("Cannot burn while persistent delegate is set")] CannotBurnWithDelegate, - /// 0xb3 - Missing edition account + /// 0xB3 - Missing edition account #[error("Missing edition account")] MissingEdition, - /// 0xb4 - Invalid Associated Token Account Program + /// 0xB4 - Invalid Associated Token Account Program #[error("Invalid Associated Token Account Program")] InvalidAssociatedTokenAccountProgram, - /// 0xb5 - Invalid InstructionsSysvar + /// 0xB5 - Invalid InstructionsSysvar #[error("Invalid InstructionsSysvar")] InvalidInstructionsSysvar, - /// 0xb6 - Invalid or Unneeded parent accounts + /// 0xB6 - Invalid or Unneeded parent accounts #[error("Invalid or Unneeded parent accounts")] InvalidParentAccounts, - /// 0xb7 - Authority cannot apply all update args + /// 0xB7 - Authority cannot apply all update args #[error("Authority cannot apply all update args")] InvalidUpdateArgs, - /// 0xb8 - Token account does not have enough tokens + /// 0xB8 - Token account does not have enough tokens #[error("Token account does not have enough tokens")] InsufficientTokenBalance, - /// 0xb9 - Missing collection account + /// 0xB9 - Missing collection account #[error("Missing collection account")] MissingCollectionMint, - /// 0xba - Missing collection master edition account + /// 0xBA - Missing collection master edition account #[error("Missing collection master edition account")] MissingCollectionMasterEdition, - /// 0xbb - Invalid token record account + /// 0xBB - Invalid token record account #[error("Invalid token record account")] InvalidTokenRecord, - /// 0xbc - The close authority needs to be revoked by the Utility Delegate + /// 0xBC - The close authority needs to be revoked by the Utility Delegate #[error("The close authority needs to be revoked by the Utility Delegate")] InvalidCloseAuthority, - /// 0xbd - Invalid or removed instruction + /// 0xBD - Invalid or removed instruction #[error("Invalid or removed instruction")] InvalidInstruction, - /// 0xbe - Missing delegate record + /// 0xBE - Missing delegate record #[error("Missing delegate record")] MissingDelegateRecord, - /// 0xbf - + /// 0xBF - #[error("")] InvalidFeeAccount, - /// 0xc0 - + /// 0xC0 - #[error("")] InvalidMetadataFlags, } + +impl solana_program::program_error::PrintProgramError for MplTokenMetadataError { + fn print(&self) { + solana_program::msg!(&self.to_string()); + } +} diff --git a/clients/rust/src/generated/instructions/approve_collection_authority.rs b/clients/rust/src/generated/instructions/approve_collection_authority.rs index d6155b36..e848b6b2 100644 --- a/clients/rust/src/generated/instructions/approve_collection_authority.rs +++ b/clients/rust/src/generated/instructions/approve_collection_authority.rs @@ -107,6 +107,8 @@ impl ApproveCollectionAuthorityBuilder { pub fn new() -> Self { Self::default() } + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -114,6 +116,8 @@ impl ApproveCollectionAuthorityBuilder { self.collection_authority_record = Some(collection_authority_record); self } + /// A Collection Authority + #[inline(always)] pub fn new_collection_authority( &mut self, new_collection_authority: solana_program::pubkey::Pubkey, @@ -121,6 +125,8 @@ impl ApproveCollectionAuthorityBuilder { self.new_collection_authority = Some(new_collection_authority); self } + /// Update Authority of Collection NFT + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -128,22 +134,33 @@ impl ApproveCollectionAuthorityBuilder { self.update_authority = Some(update_authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Collection Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint of Collection Metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self @@ -291,6 +308,8 @@ impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { }); Self { instruction } } + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -298,6 +317,8 @@ impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { self.instruction.collection_authority_record = Some(collection_authority_record); self } + /// A Collection Authority + #[inline(always)] pub fn new_collection_authority( &mut self, new_collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -305,6 +326,8 @@ impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { self.instruction.new_collection_authority = Some(new_collection_authority); self } + /// Update Authority of Collection NFT + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -312,10 +335,14 @@ impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Collection Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -323,10 +350,14 @@ impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint of Collection Metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -334,6 +365,9 @@ impl<'a> ApproveCollectionAuthorityCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self diff --git a/clients/rust/src/generated/instructions/approve_use_authority.rs b/clients/rust/src/generated/instructions/approve_use_authority.rs index 1cbc2b52..c48a8759 100644 --- a/clients/rust/src/generated/instructions/approve_use_authority.rs +++ b/clients/rust/src/generated/instructions/approve_use_authority.rs @@ -132,6 +132,8 @@ impl ApproveUseAuthorityBuilder { pub fn new() -> Self { Self::default() } + /// Use Authority Record PDA + #[inline(always)] pub fn use_authority_record( &mut self, use_authority_record: solana_program::pubkey::Pubkey, @@ -139,18 +141,26 @@ impl ApproveUseAuthorityBuilder { self.use_authority_record = Some(use_authority_record); self } + /// Owner + #[inline(always)] pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { self.owner = Some(owner); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// A Use Authority + #[inline(always)] pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self { self.user = Some(user); self } + /// Owned Token Account Of Mint + #[inline(always)] pub fn owner_token_account( &mut self, owner_token_account: solana_program::pubkey::Pubkey, @@ -158,30 +168,44 @@ impl ApproveUseAuthorityBuilder { self.owner_token_account = Some(owner_token_account); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint of Metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Program As Signer (Burner) + #[inline(always)] pub fn burner(&mut self, burner: solana_program::pubkey::Pubkey) -> &mut Self { self.burner = Some(burner); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + #[inline(always)] pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { self.number_of_uses = Some(number_of_uses); self @@ -364,6 +388,8 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { }); Self { instruction } } + /// Use Authority Record PDA + #[inline(always)] pub fn use_authority_record( &mut self, use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -371,18 +397,26 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { self.instruction.use_authority_record = Some(use_authority_record); self } + /// Owner + #[inline(always)] pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.owner = Some(owner); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// A Use Authority + #[inline(always)] pub fn user(&mut self, user: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.user = Some(user); self } + /// Owned Token Account Of Mint + #[inline(always)] pub fn owner_token_account( &mut self, owner_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -390,6 +424,8 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { self.instruction.owner_token_account = Some(owner_token_account); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -397,10 +433,14 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint of Metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Program As Signer (Burner) + #[inline(always)] pub fn burner( &mut self, burner: &'a solana_program::account_info::AccountInfo<'a>, @@ -408,6 +448,8 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { self.instruction.burner = Some(burner); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -415,6 +457,8 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -422,10 +466,14 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + #[inline(always)] pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { self.instruction.number_of_uses = Some(number_of_uses); self diff --git a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs index 1f4702f1..d1e1c400 100644 --- a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs +++ b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs @@ -96,6 +96,8 @@ impl BubblegumSetCollectionSizeBuilder { pub fn new() -> Self { Self::default() } + /// Collection Metadata account + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -103,6 +105,8 @@ impl BubblegumSetCollectionSizeBuilder { self.collection_metadata = Some(collection_metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -110,6 +114,8 @@ impl BubblegumSetCollectionSizeBuilder { self.collection_authority = Some(collection_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -117,6 +123,8 @@ impl BubblegumSetCollectionSizeBuilder { self.collection_mint = Some(collection_mint); self } + /// Signing PDA of Bubblegum program + #[inline(always)] pub fn bubblegum_signer( &mut self, bubblegum_signer: solana_program::pubkey::Pubkey, @@ -124,6 +132,9 @@ impl BubblegumSetCollectionSizeBuilder { self.bubblegum_signer = Some(bubblegum_signer); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -131,6 +142,7 @@ impl BubblegumSetCollectionSizeBuilder { self.collection_authority_record = Some(collection_authority_record); self } + #[inline(always)] pub fn set_collection_size_args( &mut self, set_collection_size_args: SetCollectionSizeArgs, @@ -259,6 +271,8 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { }); Self { instruction } } + /// Collection Metadata account + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -266,6 +280,8 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -273,6 +289,8 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -280,6 +298,8 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Signing PDA of Bubblegum program + #[inline(always)] pub fn bubblegum_signer( &mut self, bubblegum_signer: &'a solana_program::account_info::AccountInfo<'a>, @@ -287,6 +307,9 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { self.instruction.bubblegum_signer = Some(bubblegum_signer); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -294,6 +317,7 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { self.instruction.collection_authority_record = Some(collection_authority_record); self } + #[inline(always)] pub fn set_collection_size_args( &mut self, set_collection_size_args: SetCollectionSizeArgs, diff --git a/clients/rust/src/generated/instructions/burn_edition_nft.rs b/clients/rust/src/generated/instructions/burn_edition_nft.rs index b939f92f..d97852ce 100644 --- a/clients/rust/src/generated/instructions/burn_edition_nft.rs +++ b/clients/rust/src/generated/instructions/burn_edition_nft.rs @@ -116,14 +116,20 @@ impl BurnEditionNftBuilder { pub fn new() -> Self { Self::default() } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// NFT owner + #[inline(always)] pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { self.owner = Some(owner); self } + /// Mint of the print edition NFT + #[inline(always)] pub fn print_edition_mint( &mut self, print_edition_mint: solana_program::pubkey::Pubkey, @@ -131,6 +137,8 @@ impl BurnEditionNftBuilder { self.print_edition_mint = Some(print_edition_mint); self } + /// Mint of the original/master NFT + #[inline(always)] pub fn master_edition_mint( &mut self, master_edition_mint: solana_program::pubkey::Pubkey, @@ -138,6 +146,8 @@ impl BurnEditionNftBuilder { self.master_edition_mint = Some(master_edition_mint); self } + /// Token account the print edition NFT is in + #[inline(always)] pub fn print_edition_token_account( &mut self, print_edition_token_account: solana_program::pubkey::Pubkey, @@ -145,6 +155,8 @@ impl BurnEditionNftBuilder { self.print_edition_token_account = Some(print_edition_token_account); self } + /// Token account the Master Edition NFT is in + #[inline(always)] pub fn master_edition_token_account( &mut self, master_edition_token_account: solana_program::pubkey::Pubkey, @@ -152,6 +164,8 @@ impl BurnEditionNftBuilder { self.master_edition_token_account = Some(master_edition_token_account); self } + /// MasterEdition2 of the original NFT + #[inline(always)] pub fn master_edition_account( &mut self, master_edition_account: solana_program::pubkey::Pubkey, @@ -159,6 +173,8 @@ impl BurnEditionNftBuilder { self.master_edition_account = Some(master_edition_account); self } + /// Print Edition account of the NFT + #[inline(always)] pub fn print_edition_account( &mut self, print_edition_account: solana_program::pubkey::Pubkey, @@ -166,6 +182,8 @@ impl BurnEditionNftBuilder { self.print_edition_account = Some(print_edition_account); self } + /// Edition Marker PDA of the NFT + #[inline(always)] pub fn edition_marker_account( &mut self, edition_marker_account: solana_program::pubkey::Pubkey, @@ -173,6 +191,8 @@ impl BurnEditionNftBuilder { self.edition_marker_account = Some(edition_marker_account); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -343,6 +363,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { }); Self { instruction } } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -350,10 +372,14 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// NFT owner + #[inline(always)] pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.owner = Some(owner); self } + /// Mint of the print edition NFT + #[inline(always)] pub fn print_edition_mint( &mut self, print_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -361,6 +387,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.print_edition_mint = Some(print_edition_mint); self } + /// Mint of the original/master NFT + #[inline(always)] pub fn master_edition_mint( &mut self, master_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -368,6 +396,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.master_edition_mint = Some(master_edition_mint); self } + /// Token account the print edition NFT is in + #[inline(always)] pub fn print_edition_token_account( &mut self, print_edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -375,6 +405,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.print_edition_token_account = Some(print_edition_token_account); self } + /// Token account the Master Edition NFT is in + #[inline(always)] pub fn master_edition_token_account( &mut self, master_edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -382,6 +414,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.master_edition_token_account = Some(master_edition_token_account); self } + /// MasterEdition2 of the original NFT + #[inline(always)] pub fn master_edition_account( &mut self, master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -389,6 +423,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.master_edition_account = Some(master_edition_account); self } + /// Print Edition account of the NFT + #[inline(always)] pub fn print_edition_account( &mut self, print_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -396,6 +432,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.print_edition_account = Some(print_edition_account); self } + /// Edition Marker PDA of the NFT + #[inline(always)] pub fn edition_marker_account( &mut self, edition_marker_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -403,6 +441,8 @@ impl<'a> BurnEditionNftCpiBuilder<'a> { self.instruction.edition_marker_account = Some(edition_marker_account); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/burn_nft.rs b/clients/rust/src/generated/instructions/burn_nft.rs index 4a71a752..8c360217 100644 --- a/clients/rust/src/generated/instructions/burn_nft.rs +++ b/clients/rust/src/generated/instructions/burn_nft.rs @@ -101,22 +101,32 @@ impl BurnNftBuilder { pub fn new() -> Self { Self::default() } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// NFT owner + #[inline(always)] pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { self.owner = Some(owner); self } + /// Mint of the NFT + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account to close + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// MasterEdition2 of the NFT + #[inline(always)] pub fn master_edition_account( &mut self, master_edition_account: solana_program::pubkey::Pubkey, @@ -124,6 +134,8 @@ impl BurnNftBuilder { self.master_edition_account = Some(master_edition_account); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -131,6 +143,9 @@ impl BurnNftBuilder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Metadata of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -271,6 +286,8 @@ impl<'a> BurnNftCpiBuilder<'a> { }); Self { instruction } } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -278,14 +295,20 @@ impl<'a> BurnNftCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// NFT owner + #[inline(always)] pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.owner = Some(owner); self } + /// Mint of the NFT + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account to close + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -293,6 +316,8 @@ impl<'a> BurnNftCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// MasterEdition2 of the NFT + #[inline(always)] pub fn master_edition_account( &mut self, master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -300,6 +325,8 @@ impl<'a> BurnNftCpiBuilder<'a> { self.instruction.master_edition_account = Some(master_edition_account); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -307,6 +334,9 @@ impl<'a> BurnNftCpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Metadata of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/burn_v1.rs b/clients/rust/src/generated/instructions/burn_v1.rs index 67ad65f9..0328a615 100644 --- a/clients/rust/src/generated/instructions/burn_v1.rs +++ b/clients/rust/src/generated/instructions/burn_v1.rs @@ -198,10 +198,15 @@ impl BurnV1Builder { pub fn new() -> Self { Self::default() } + /// Asset owner or Utility delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Metadata of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -209,26 +214,41 @@ impl BurnV1Builder { self.collection_metadata = Some(collection_metadata); self } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition of the asset + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account to close + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// `[optional account]` + /// Master edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Master edition mint of the asset + #[inline(always)] pub fn master_edition_mint( &mut self, master_edition_mint: solana_program::pubkey::Pubkey, @@ -236,6 +256,9 @@ impl BurnV1Builder { self.master_edition_mint = Some(master_edition_mint); self } + /// `[optional account]` + /// Master edition token account + #[inline(always)] pub fn master_edition_token( &mut self, master_edition_token: solana_program::pubkey::Pubkey, @@ -243,18 +266,28 @@ impl BurnV1Builder { self.master_edition_token = Some(master_edition_token); self } + /// `[optional account]` + /// Edition marker account + #[inline(always)] pub fn edition_marker(&mut self, edition_marker: solana_program::pubkey::Pubkey) -> &mut Self { self.edition_marker = Some(edition_marker); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -262,6 +295,8 @@ impl BurnV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -269,6 +304,7 @@ impl BurnV1Builder { self.spl_token_program = Some(spl_token_program); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self @@ -526,6 +562,8 @@ impl<'a> BurnV1CpiBuilder<'a> { }); Self { instruction } } + /// Asset owner or Utility delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -533,6 +571,9 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Metadata of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -540,6 +581,8 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -547,6 +590,9 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition of the asset + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -554,14 +600,21 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account to close + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// `[optional account]` + /// Master edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -569,6 +622,9 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Master edition mint of the asset + #[inline(always)] pub fn master_edition_mint( &mut self, master_edition_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -576,6 +632,9 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.master_edition_mint = Some(master_edition_mint); self } + /// `[optional account]` + /// Master edition token account + #[inline(always)] pub fn master_edition_token( &mut self, master_edition_token: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +642,9 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.master_edition_token = Some(master_edition_token); self } + /// `[optional account]` + /// Edition marker account + #[inline(always)] pub fn edition_marker( &mut self, edition_marker: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +652,9 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.edition_marker = Some(edition_marker); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +662,8 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +671,8 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +680,8 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -618,6 +689,7 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self diff --git a/clients/rust/src/generated/instructions/close_escrow_account.rs b/clients/rust/src/generated/instructions/close_escrow_account.rs index a752aad5..20dd391a 100644 --- a/clients/rust/src/generated/instructions/close_escrow_account.rs +++ b/clients/rust/src/generated/instructions/close_escrow_account.rs @@ -101,34 +101,50 @@ impl CloseEscrowAccountBuilder { pub fn new() -> Self { Self::default() } + /// Escrow account + #[inline(always)] pub fn escrow(&mut self, escrow: solana_program::pubkey::Pubkey) -> &mut Self { self.escrow = Some(escrow); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Wallet paying for the transaction and new account + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -269,6 +285,8 @@ impl<'a> CloseEscrowAccountCpiBuilder<'a> { }); Self { instruction } } + /// Escrow account + #[inline(always)] pub fn escrow( &mut self, escrow: &'a solana_program::account_info::AccountInfo<'a>, @@ -276,6 +294,8 @@ impl<'a> CloseEscrowAccountCpiBuilder<'a> { self.instruction.escrow = Some(escrow); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -283,10 +303,14 @@ impl<'a> CloseEscrowAccountCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -294,6 +318,8 @@ impl<'a> CloseEscrowAccountCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -301,10 +327,14 @@ impl<'a> CloseEscrowAccountCpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Wallet paying for the transaction and new account + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -312,6 +342,8 @@ impl<'a> CloseEscrowAccountCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/collect.rs b/clients/rust/src/generated/instructions/collect.rs index 8709c922..a2f1cc6b 100644 --- a/clients/rust/src/generated/instructions/collect.rs +++ b/clients/rust/src/generated/instructions/collect.rs @@ -61,10 +61,14 @@ impl CollectBuilder { pub fn new() -> Self { Self::default() } + /// Authority to collect fees + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// PDA to retrieve fees from + #[inline(always)] pub fn pda_account(&mut self, pda_account: solana_program::pubkey::Pubkey) -> &mut Self { self.pda_account = Some(pda_account); self @@ -144,6 +148,8 @@ impl<'a> CollectCpiBuilder<'a> { }); Self { instruction } } + /// Authority to collect fees + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -151,6 +157,8 @@ impl<'a> CollectCpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// PDA to retrieve fees from + #[inline(always)] pub fn pda_account( &mut self, pda_account: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs index 7f11c30d..52ea6aae 100644 --- a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs +++ b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs @@ -68,14 +68,20 @@ impl ConvertMasterEditionV1ToV2Builder { pub fn new() -> Self { Self::default() } + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// One time authorization mint + #[inline(always)] pub fn one_time_auth(&mut self, one_time_auth: solana_program::pubkey::Pubkey) -> &mut Self { self.one_time_auth = Some(one_time_auth); self } + /// Printing mint + #[inline(always)] pub fn printing_mint(&mut self, printing_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.printing_mint = Some(printing_mint); self @@ -164,6 +170,8 @@ impl<'a> ConvertMasterEditionV1ToV2CpiBuilder<'a> { }); Self { instruction } } + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -171,6 +179,8 @@ impl<'a> ConvertMasterEditionV1ToV2CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// One time authorization mint + #[inline(always)] pub fn one_time_auth( &mut self, one_time_auth: &'a solana_program::account_info::AccountInfo<'a>, @@ -178,6 +188,8 @@ impl<'a> ConvertMasterEditionV1ToV2CpiBuilder<'a> { self.instruction.one_time_auth = Some(one_time_auth); self } + /// Printing mint + #[inline(always)] pub fn printing_mint( &mut self, printing_mint: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/create_escrow_account.rs b/clients/rust/src/generated/instructions/create_escrow_account.rs index 6154f09a..ba1422b4 100644 --- a/clients/rust/src/generated/instructions/create_escrow_account.rs +++ b/clients/rust/src/generated/instructions/create_escrow_account.rs @@ -114,34 +114,50 @@ impl CreateEscrowAccountBuilder { pub fn new() -> Self { Self::default() } + /// Escrow account + #[inline(always)] pub fn escrow(&mut self, escrow: solana_program::pubkey::Pubkey) -> &mut Self { self.escrow = Some(escrow); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of the token + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Wallet paying for the transaction and new account + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -149,6 +165,9 @@ impl CreateEscrowAccountBuilder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Authority/creator of the escrow account + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self @@ -304,6 +323,8 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { }); Self { instruction } } + /// Escrow account + #[inline(always)] pub fn escrow( &mut self, escrow: &'a solana_program::account_info::AccountInfo<'a>, @@ -311,6 +332,8 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { self.instruction.escrow = Some(escrow); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -318,10 +341,14 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of the token + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -329,6 +356,8 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -336,10 +365,14 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Wallet paying for the transaction and new account + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -347,6 +380,8 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -354,6 +389,9 @@ impl<'a> CreateEscrowAccountCpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Authority/creator of the escrow account + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/create_master_edition_v3.rs b/clients/rust/src/generated/instructions/create_master_edition_v3.rs index 2fb4da0e..1a777d67 100644 --- a/clients/rust/src/generated/instructions/create_master_edition_v3.rs +++ b/clients/rust/src/generated/instructions/create_master_edition_v3.rs @@ -120,14 +120,20 @@ impl CreateMasterEditionV3Builder { pub fn new() -> Self { Self::default() } + /// Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition'] + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Metadata mint + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Update authority + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -135,30 +141,45 @@ impl CreateMasterEditionV3Builder { self.update_authority = Some(update_authority); self } + /// Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn mint_authority(&mut self, mint_authority: solana_program::pubkey::Pubkey) -> &mut Self { self.mint_authority = Some(mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + /// `[optional argument]` + #[inline(always)] pub fn max_supply(&mut self, max_supply: u64) -> &mut Self { self.max_supply = Some(max_supply); self @@ -315,6 +336,8 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { }); Self { instruction } } + /// Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition'] + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -322,10 +345,14 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Metadata mint + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Update authority + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -333,6 +360,8 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn mint_authority( &mut self, mint_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -340,10 +369,14 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { self.instruction.mint_authority = Some(mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -351,6 +384,8 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -358,6 +393,8 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -365,10 +402,15 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + /// `[optional argument]` + #[inline(always)] pub fn max_supply(&mut self, max_supply: u64) -> &mut Self { self.instruction.max_supply = Some(max_supply); self diff --git a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs index 08148ba6..94ce9fa4 100644 --- a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs +++ b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs @@ -118,22 +118,32 @@ impl CreateMetadataAccountV3Builder { pub fn new() -> Self { Self::default() } + /// Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Mint authority + #[inline(always)] pub fn mint_authority(&mut self, mint_authority: solana_program::pubkey::Pubkey) -> &mut Self { self.mint_authority = Some(mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// update authority info + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -141,22 +151,31 @@ impl CreateMetadataAccountV3Builder { self.update_authority = Some(update_authority); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + #[inline(always)] pub fn data(&mut self, data: DataV2) -> &mut Self { self.data = Some(data); self } + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); self } + /// `[optional argument]` + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { self.collection_details = Some(collection_details); self @@ -299,6 +318,8 @@ impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { }); Self { instruction } } + /// Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -306,10 +327,14 @@ impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Mint authority + #[inline(always)] pub fn mint_authority( &mut self, mint_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -317,10 +342,14 @@ impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { self.instruction.mint_authority = Some(mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// update authority info + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -328,6 +357,8 @@ impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -335,18 +366,25 @@ impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + #[inline(always)] pub fn data(&mut self, data: DataV2) -> &mut Self { self.instruction.data = Some(data); self } + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); self } + /// `[optional argument]` + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { self.instruction.collection_details = Some(collection_details); self diff --git a/clients/rust/src/generated/instructions/create_v1.rs b/clients/rust/src/generated/instructions/create_v1.rs index 525a61a1..1130f331 100644 --- a/clients/rust/src/generated/instructions/create_v1.rs +++ b/clients/rust/src/generated/instructions/create_v1.rs @@ -176,26 +176,39 @@ impl CreateV1Builder { pub fn new() -> Self { Self::default() } + /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey, as_signer: bool) -> &mut Self { self.mint = Some((mint, as_signer)); self } + /// Mint authority + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Update authority for the metadata account + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -204,10 +217,14 @@ impl CreateV1Builder { self.update_authority = Some((update_authority, as_signer)); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -215,6 +232,8 @@ impl CreateV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -222,58 +241,79 @@ impl CreateV1Builder { self.spl_token_program = Some(spl_token_program); self } + #[inline(always)] pub fn name(&mut self, name: String) -> &mut Self { self.name = Some(name); self } + #[inline(always)] pub fn symbol(&mut self, symbol: String) -> &mut Self { self.symbol = Some(symbol); self } + #[inline(always)] pub fn uri(&mut self, uri: String) -> &mut Self { self.uri = Some(uri); self } + #[inline(always)] pub fn seller_fee_basis_points(&mut self, seller_fee_basis_points: u16) -> &mut Self { self.seller_fee_basis_points = Some(seller_fee_basis_points); self } + /// `[optional argument]` + #[inline(always)] pub fn creators(&mut self, creators: Vec) -> &mut Self { self.creators = Some(creators); self } + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.primary_sale_happened = Some(primary_sale_happened); self } + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); self } + #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.token_standard = Some(token_standard); self } + /// `[optional argument]` + #[inline(always)] pub fn collection(&mut self, collection: Collection) -> &mut Self { self.collection = Some(collection); self } + /// `[optional argument]` + #[inline(always)] pub fn uses(&mut self, uses: Uses) -> &mut Self { self.uses = Some(uses); self } + /// `[optional argument]` + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { self.collection_details = Some(collection_details); self } + /// `[optional argument]` + #[inline(always)] pub fn rule_set(&mut self, rule_set: Pubkey) -> &mut Self { self.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn decimals(&mut self, decimals: u8) -> &mut Self { self.decimals = Some(decimals); self } + /// `[optional argument]` + #[inline(always)] pub fn print_supply(&mut self, print_supply: PrintSupply) -> &mut Self { self.print_supply = Some(print_supply); self @@ -471,6 +511,8 @@ impl<'a> CreateV1CpiBuilder<'a> { }); Self { instruction } } + /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -478,6 +520,9 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -485,6 +530,8 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// Mint of token asset + #[inline(always)] pub fn mint( &mut self, mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -493,6 +540,8 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.mint = Some((mint, as_signer)); self } + /// Mint authority + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -500,10 +549,14 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Update authority for the metadata account + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -512,6 +565,8 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.update_authority = Some((update_authority, as_signer)); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -519,6 +574,8 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -526,6 +583,8 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -533,58 +592,79 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + #[inline(always)] pub fn name(&mut self, name: String) -> &mut Self { self.instruction.name = Some(name); self } + #[inline(always)] pub fn symbol(&mut self, symbol: String) -> &mut Self { self.instruction.symbol = Some(symbol); self } + #[inline(always)] pub fn uri(&mut self, uri: String) -> &mut Self { self.instruction.uri = Some(uri); self } + #[inline(always)] pub fn seller_fee_basis_points(&mut self, seller_fee_basis_points: u16) -> &mut Self { self.instruction.seller_fee_basis_points = Some(seller_fee_basis_points); self } + /// `[optional argument]` + #[inline(always)] pub fn creators(&mut self, creators: Vec) -> &mut Self { self.instruction.creators = Some(creators); self } + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.instruction.primary_sale_happened = Some(primary_sale_happened); self } + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); self } + #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.instruction.token_standard = Some(token_standard); self } + /// `[optional argument]` + #[inline(always)] pub fn collection(&mut self, collection: Collection) -> &mut Self { self.instruction.collection = Some(collection); self } + /// `[optional argument]` + #[inline(always)] pub fn uses(&mut self, uses: Uses) -> &mut Self { self.instruction.uses = Some(uses); self } + /// `[optional argument]` + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetails) -> &mut Self { self.instruction.collection_details = Some(collection_details); self } + /// `[optional argument]` + #[inline(always)] pub fn rule_set(&mut self, rule_set: Pubkey) -> &mut Self { self.instruction.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn decimals(&mut self, decimals: u8) -> &mut Self { self.instruction.decimals = Some(decimals); self } + /// `[optional argument]` + #[inline(always)] pub fn print_supply(&mut self, print_supply: PrintSupply) -> &mut Self { self.instruction.print_supply = Some(print_supply); self diff --git a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs index 0b3a0113..0a22d6ab 100644 --- a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs @@ -197,6 +197,9 @@ impl DelegateAuthorityItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateAuthorityItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateAuthorityItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateAuthorityItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateAuthorityItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateAuthorityItemV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs index 6aa4fbbd..dfa48448 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs @@ -197,6 +197,9 @@ impl DelegateCollectionItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateCollectionItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateCollectionItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateCollectionItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateCollectionItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateCollectionItemV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_collection_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_v1.rs index 82d41391..a1f6b936 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_v1.rs @@ -197,6 +197,9 @@ impl DelegateCollectionV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateCollectionV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateCollectionV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateCollectionV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateCollectionV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateCollectionV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs index 0a3b3a44..1932be8e 100644 --- a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs @@ -197,6 +197,9 @@ impl DelegateDataItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateDataItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateDataItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateDataItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateDataItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateDataItemV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_data_v1.rs b/clients/rust/src/generated/instructions/delegate_data_v1.rs index e660b3e4..bc0c1a8b 100644 --- a/clients/rust/src/generated/instructions/delegate_data_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_v1.rs @@ -197,6 +197,9 @@ impl DelegateDataV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateDataV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateDataV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateDataV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateDataV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateDataV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs index e42a3f02..d5fc256f 100644 --- a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs @@ -200,6 +200,9 @@ impl DelegateLockedTransferV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -207,42 +210,64 @@ impl DelegateLockedTransferV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -250,6 +275,9 @@ impl DelegateLockedTransferV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -257,6 +285,9 @@ impl DelegateLockedTransferV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -264,6 +295,9 @@ impl DelegateLockedTransferV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -271,14 +305,18 @@ impl DelegateLockedTransferV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + #[inline(always)] pub fn locked_address(&mut self, locked_address: Pubkey) -> &mut Self { self.locked_address = Some(locked_address); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -536,6 +574,9 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +584,8 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +593,8 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,6 +602,9 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -564,6 +612,9 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -571,14 +622,20 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -586,10 +643,14 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +658,8 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +667,9 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +677,9 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -618,6 +687,9 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -625,14 +697,18 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + #[inline(always)] pub fn locked_address(&mut self, locked_address: Pubkey) -> &mut Self { self.instruction.locked_address = Some(locked_address); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs index 399a86df..e0ef44a3 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs @@ -197,6 +197,9 @@ impl DelegateProgrammableConfigItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateProgrammableConfigItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateProgrammableConfigItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateProgrammableConfigItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateProgrammableConfigItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateProgrammableConfigItemV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs index 8e18811a..e66a79f5 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs @@ -197,6 +197,9 @@ impl DelegateProgrammableConfigV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -204,42 +207,65 @@ impl DelegateProgrammableConfigV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -247,6 +273,9 @@ impl DelegateProgrammableConfigV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -254,6 +283,9 @@ impl DelegateProgrammableConfigV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -261,6 +293,9 @@ impl DelegateProgrammableConfigV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -268,6 +303,8 @@ impl DelegateProgrammableConfigV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -522,6 +559,9 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +569,8 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +578,8 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,6 +587,9 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,6 +597,9 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -557,14 +607,21 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -572,10 +629,14 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +644,8 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +653,9 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +663,9 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -604,6 +673,9 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -611,6 +683,8 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_sale_v1.rs b/clients/rust/src/generated/instructions/delegate_sale_v1.rs index 7ce8737f..57860ecd 100644 --- a/clients/rust/src/generated/instructions/delegate_sale_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_sale_v1.rs @@ -195,6 +195,9 @@ impl DelegateSaleV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -202,42 +205,64 @@ impl DelegateSaleV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -245,6 +270,9 @@ impl DelegateSaleV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -252,6 +280,9 @@ impl DelegateSaleV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -259,6 +290,9 @@ impl DelegateSaleV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -266,10 +300,13 @@ impl DelegateSaleV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -517,6 +554,9 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -524,6 +564,8 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -531,6 +573,8 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -538,6 +582,9 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -545,6 +592,9 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -552,14 +602,20 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,10 +623,14 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -578,6 +638,8 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -585,6 +647,9 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -592,6 +657,9 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -599,6 +667,9 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -606,10 +677,13 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_staking_v1.rs b/clients/rust/src/generated/instructions/delegate_staking_v1.rs index 8d5dfc56..20bafd4b 100644 --- a/clients/rust/src/generated/instructions/delegate_staking_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_staking_v1.rs @@ -195,6 +195,9 @@ impl DelegateStakingV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -202,42 +205,64 @@ impl DelegateStakingV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -245,6 +270,9 @@ impl DelegateStakingV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -252,6 +280,9 @@ impl DelegateStakingV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -259,6 +290,9 @@ impl DelegateStakingV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -266,10 +300,13 @@ impl DelegateStakingV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -517,6 +554,9 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -524,6 +564,8 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -531,6 +573,8 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -538,6 +582,9 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -545,6 +592,9 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -552,14 +602,20 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,10 +623,14 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -578,6 +638,8 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -585,6 +647,9 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -592,6 +657,9 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -599,6 +667,9 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -606,10 +677,13 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_standard_v1.rs b/clients/rust/src/generated/instructions/delegate_standard_v1.rs index d244ec5b..35c46a6f 100644 --- a/clients/rust/src/generated/instructions/delegate_standard_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_standard_v1.rs @@ -191,6 +191,9 @@ impl DelegateStandardV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -198,42 +201,64 @@ impl DelegateStandardV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -241,6 +266,9 @@ impl DelegateStandardV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -248,6 +276,9 @@ impl DelegateStandardV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -255,6 +286,9 @@ impl DelegateStandardV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -262,6 +296,7 @@ impl DelegateStandardV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self @@ -508,6 +543,9 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -515,6 +553,8 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -522,6 +562,8 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -529,6 +571,9 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +581,9 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,14 +591,20 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -558,10 +612,14 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -569,6 +627,8 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -576,6 +636,9 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -583,6 +646,9 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -590,6 +656,9 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -597,6 +666,7 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self diff --git a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs index 648ca3d8..6194c78c 100644 --- a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs @@ -195,6 +195,9 @@ impl DelegateTransferV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -202,42 +205,64 @@ impl DelegateTransferV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -245,6 +270,9 @@ impl DelegateTransferV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -252,6 +280,9 @@ impl DelegateTransferV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -259,6 +290,9 @@ impl DelegateTransferV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -266,10 +300,13 @@ impl DelegateTransferV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -517,6 +554,9 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -524,6 +564,8 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -531,6 +573,8 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -538,6 +582,9 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -545,6 +592,9 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -552,14 +602,20 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,10 +623,14 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -578,6 +638,8 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -585,6 +647,9 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -592,6 +657,9 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -599,6 +667,9 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -606,10 +677,13 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/delegate_utility_v1.rs b/clients/rust/src/generated/instructions/delegate_utility_v1.rs index 68ceed82..abd290a3 100644 --- a/clients/rust/src/generated/instructions/delegate_utility_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_utility_v1.rs @@ -195,6 +195,9 @@ impl DelegateUtilityV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -202,42 +205,64 @@ impl DelegateUtilityV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -245,6 +270,9 @@ impl DelegateUtilityV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -252,6 +280,9 @@ impl DelegateUtilityV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -259,6 +290,9 @@ impl DelegateUtilityV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -266,10 +300,13 @@ impl DelegateUtilityV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -517,6 +554,9 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -524,6 +564,8 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -531,6 +573,8 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -538,6 +582,9 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -545,6 +592,9 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -552,14 +602,20 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,10 +623,14 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -578,6 +638,8 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -585,6 +647,9 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -592,6 +657,9 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -599,6 +667,9 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -606,10 +677,13 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs index d36c4080..058bf289 100644 --- a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs +++ b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs @@ -163,30 +163,44 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenBuilder { pub fn new() -> Self { Self::default() } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// New Edition V1 (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Mint authority of new mint + #[inline(always)] pub fn mint_authority(&mut self, mint_authority: solana_program::pubkey::Pubkey) -> &mut Self { self.mint_authority = Some(mint_authority); self } + /// Printing Mint of master record edition + #[inline(always)] pub fn printing_mint(&mut self, printing_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.printing_mint = Some(printing_mint); self } + /// Token account containing Printing mint token to be transferred + #[inline(always)] pub fn master_token_account( &mut self, master_token_account: solana_program::pubkey::Pubkey, @@ -194,18 +208,26 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenBuilder { self.master_token_account = Some(master_token_account); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number]) + #[inline(always)] pub fn edition_marker(&mut self, edition_marker: solana_program::pubkey::Pubkey) -> &mut Self { self.edition_marker = Some(edition_marker); self } + /// Burn authority for this token + #[inline(always)] pub fn burn_authority(&mut self, burn_authority: solana_program::pubkey::Pubkey) -> &mut Self { self.burn_authority = Some(burn_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// update authority info for new metadata account + #[inline(always)] pub fn master_update_authority( &mut self, master_update_authority: solana_program::pubkey::Pubkey, @@ -213,6 +235,8 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenBuilder { self.master_update_authority = Some(master_update_authority); self } + /// Master record metadata account + #[inline(always)] pub fn master_metadata( &mut self, master_metadata: solana_program::pubkey::Pubkey, @@ -220,18 +244,27 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenBuilder { self.master_metadata = Some(master_metadata); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + /// `[optional account]` + /// Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list. + #[inline(always)] pub fn reservation_list( &mut self, reservation_list: solana_program::pubkey::Pubkey, @@ -462,6 +495,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> ); Self { instruction } } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -469,6 +504,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.metadata = Some(metadata); self } + /// New Edition V1 (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -476,6 +513,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.edition = Some(edition); self } + /// Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -483,10 +522,14 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.master_edition = Some(master_edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Mint authority of new mint + #[inline(always)] pub fn mint_authority( &mut self, mint_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -494,6 +537,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.mint_authority = Some(mint_authority); self } + /// Printing Mint of master record edition + #[inline(always)] pub fn printing_mint( &mut self, printing_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -501,6 +546,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.printing_mint = Some(printing_mint); self } + /// Token account containing Printing mint token to be transferred + #[inline(always)] pub fn master_token_account( &mut self, master_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -508,6 +555,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.master_token_account = Some(master_token_account); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number]) + #[inline(always)] pub fn edition_marker( &mut self, edition_marker: &'a solana_program::account_info::AccountInfo<'a>, @@ -515,6 +564,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.edition_marker = Some(edition_marker); self } + /// Burn authority for this token + #[inline(always)] pub fn burn_authority( &mut self, burn_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -522,10 +573,14 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.burn_authority = Some(burn_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// update authority info for new metadata account + #[inline(always)] pub fn master_update_authority( &mut self, master_update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -533,6 +588,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.master_update_authority = Some(master_update_authority); self } + /// Master record metadata account + #[inline(always)] pub fn master_metadata( &mut self, master_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -540,6 +597,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.master_metadata = Some(master_metadata); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -547,6 +606,8 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -554,10 +615,15 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpiBuilder<'a> self.instruction.system_program = Some(system_program); self } + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + /// `[optional account]` + /// Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list. + #[inline(always)] pub fn reservation_list( &mut self, reservation_list: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/freeze_delegated_account.rs b/clients/rust/src/generated/instructions/freeze_delegated_account.rs index 2bb5e061..4cc24a4b 100644 --- a/clients/rust/src/generated/instructions/freeze_delegated_account.rs +++ b/clients/rust/src/generated/instructions/freeze_delegated_account.rs @@ -81,22 +81,32 @@ impl FreezeDelegatedAccountBuilder { pub fn new() -> Self { Self::default() } + /// Delegate + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Token account to freeze + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// Edition + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Token mint + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token Program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self @@ -205,6 +215,8 @@ impl<'a> FreezeDelegatedAccountCpiBuilder<'a> { }); Self { instruction } } + /// Delegate + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -212,6 +224,8 @@ impl<'a> FreezeDelegatedAccountCpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Token account to freeze + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -219,6 +233,8 @@ impl<'a> FreezeDelegatedAccountCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// Edition + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -226,10 +242,14 @@ impl<'a> FreezeDelegatedAccountCpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Token mint + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token Program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/lock_v1.rs b/clients/rust/src/generated/instructions/lock_v1.rs index 04fd99ad..3dd6c9de 100644 --- a/clients/rust/src/generated/instructions/lock_v1.rs +++ b/clients/rust/src/generated/instructions/lock_v1.rs @@ -184,42 +184,65 @@ impl LockV1Builder { pub fn new() -> Self { Self::default() } + /// Delegate or freeze authority + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Token owner account + #[inline(always)] pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { self.token_owner = Some(token_owner); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// System program + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -227,6 +250,9 @@ impl LockV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -234,6 +260,9 @@ impl LockV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -241,6 +270,9 @@ impl LockV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -248,6 +280,8 @@ impl LockV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -485,6 +519,8 @@ impl<'a> LockV1CpiBuilder<'a> { }); Self { instruction } } + /// Delegate or freeze authority + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -492,6 +528,9 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Token owner account + #[inline(always)] pub fn token_owner( &mut self, token_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -499,14 +538,20 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.token_owner = Some(token_owner); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +559,9 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +569,9 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,10 +579,14 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -539,6 +594,8 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// System program + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -546,6 +603,9 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -553,6 +613,9 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -560,6 +623,9 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,6 +633,8 @@ impl<'a> LockV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/migrate.rs b/clients/rust/src/generated/instructions/migrate.rs index 1c73b804..b3ea856b 100644 --- a/clients/rust/src/generated/instructions/migrate.rs +++ b/clients/rust/src/generated/instructions/migrate.rs @@ -163,34 +163,50 @@ impl MigrateBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Token account owner + #[inline(always)] pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { self.token_owner = Some(token_owner); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Update authority + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Collection metadata account + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -198,6 +214,8 @@ impl MigrateBuilder { self.collection_metadata = Some(collection_metadata); self } + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -205,14 +223,20 @@ impl MigrateBuilder { self.delegate_record = Some(delegate_record); self } + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instruction sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -220,6 +244,8 @@ impl MigrateBuilder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -227,6 +253,9 @@ impl MigrateBuilder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -234,6 +263,9 @@ impl MigrateBuilder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -459,6 +491,8 @@ impl<'a> MigrateCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -466,6 +500,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -473,10 +509,14 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Token account owner + #[inline(always)] pub fn token_owner( &mut self, token_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -484,14 +524,20 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.token_owner = Some(token_owner); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Update authority + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -499,6 +545,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Collection metadata account + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -506,6 +554,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -513,6 +563,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +572,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +581,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instruction sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +590,8 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +599,9 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,6 +609,9 @@ impl<'a> MigrateCpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs index ea43ab08..60cf9847 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs @@ -161,22 +161,32 @@ impl MintNewEditionFromMasterEditionViaTokenBuilder { pub fn new() -> Self { Self::default() } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn new_metadata(&mut self, new_metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.new_metadata = Some(new_metadata); self } + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn new_edition(&mut self, new_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.new_edition = Some(new_edition); self } + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn new_mint(&mut self, new_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.new_mint = Some(new_mint); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + #[inline(always)] pub fn edition_mark_pda( &mut self, edition_mark_pda: solana_program::pubkey::Pubkey, @@ -184,6 +194,8 @@ impl MintNewEditionFromMasterEditionViaTokenBuilder { self.edition_mark_pda = Some(edition_mark_pda); self } + /// Mint authority of new mint + #[inline(always)] pub fn new_mint_authority( &mut self, new_mint_authority: solana_program::pubkey::Pubkey, @@ -191,10 +203,14 @@ impl MintNewEditionFromMasterEditionViaTokenBuilder { self.new_mint_authority = Some(new_mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// owner of token account containing master token (#8) + #[inline(always)] pub fn token_account_owner( &mut self, token_account_owner: solana_program::pubkey::Pubkey, @@ -202,10 +218,14 @@ impl MintNewEditionFromMasterEditionViaTokenBuilder { self.token_account_owner = Some(token_account_owner); self } + /// token account containing token from master metadata mint + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// Update authority info for new metadata + #[inline(always)] pub fn new_metadata_update_authority( &mut self, new_metadata_update_authority: solana_program::pubkey::Pubkey, @@ -213,22 +233,32 @@ impl MintNewEditionFromMasterEditionViaTokenBuilder { self.new_metadata_update_authority = Some(new_metadata_update_authority); self } + /// Master record metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + #[inline(always)] pub fn mint_new_edition_from_master_edition_via_token_args( &mut self, mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, @@ -446,6 +476,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { ); Self { instruction } } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn new_metadata( &mut self, new_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -453,6 +485,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.new_metadata = Some(new_metadata); self } + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn new_edition( &mut self, new_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -460,6 +494,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.new_edition = Some(new_edition); self } + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -467,6 +503,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn new_mint( &mut self, new_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -474,6 +512,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.new_mint = Some(new_mint); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + #[inline(always)] pub fn edition_mark_pda( &mut self, edition_mark_pda: &'a solana_program::account_info::AccountInfo<'a>, @@ -481,6 +521,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.edition_mark_pda = Some(edition_mark_pda); self } + /// Mint authority of new mint + #[inline(always)] pub fn new_mint_authority( &mut self, new_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -488,10 +530,14 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.new_mint_authority = Some(new_mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// owner of token account containing master token (#8) + #[inline(always)] pub fn token_account_owner( &mut self, token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -499,6 +545,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.token_account_owner = Some(token_account_owner); self } + /// token account containing token from master metadata mint + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -506,6 +554,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// Update authority info for new metadata + #[inline(always)] pub fn new_metadata_update_authority( &mut self, new_metadata_update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -513,6 +563,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.new_metadata_update_authority = Some(new_metadata_update_authority); self } + /// Master record metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +572,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +581,8 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,10 +590,14 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + #[inline(always)] pub fn mint_new_edition_from_master_edition_via_token_args( &mut self, mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs index 79c5ad9f..222facb1 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs @@ -181,22 +181,32 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { pub fn new() -> Self { Self::default() } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn new_metadata(&mut self, new_metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.new_metadata = Some(new_metadata); self } + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn new_edition(&mut self, new_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.new_edition = Some(new_edition); self } + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'] + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn new_mint(&mut self, new_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.new_mint = Some(new_mint); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + #[inline(always)] pub fn edition_mark_pda( &mut self, edition_mark_pda: solana_program::pubkey::Pubkey, @@ -204,6 +214,8 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.edition_mark_pda = Some(edition_mark_pda); self } + /// Mint authority of new mint + #[inline(always)] pub fn new_mint_authority( &mut self, new_mint_authority: solana_program::pubkey::Pubkey, @@ -211,10 +223,14 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.new_mint_authority = Some(new_mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Vault authority + #[inline(always)] pub fn vault_authority( &mut self, vault_authority: solana_program::pubkey::Pubkey, @@ -222,6 +238,8 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.vault_authority = Some(vault_authority); self } + /// Safety deposit token store account + #[inline(always)] pub fn safety_deposit_store( &mut self, safety_deposit_store: solana_program::pubkey::Pubkey, @@ -229,6 +247,8 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.safety_deposit_store = Some(safety_deposit_store); self } + /// Safety deposit box + #[inline(always)] pub fn safety_deposit_box( &mut self, safety_deposit_box: solana_program::pubkey::Pubkey, @@ -236,10 +256,14 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.safety_deposit_box = Some(safety_deposit_box); self } + /// Vault + #[inline(always)] pub fn vault(&mut self, vault: solana_program::pubkey::Pubkey) -> &mut Self { self.vault = Some(vault); self } + /// Update authority info for new metadata + #[inline(always)] pub fn new_metadata_update_authority( &mut self, new_metadata_update_authority: solana_program::pubkey::Pubkey, @@ -247,14 +271,20 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.new_metadata_update_authority = Some(new_metadata_update_authority); self } + /// Master record metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// Token vault program + #[inline(always)] pub fn token_vault_program( &mut self, token_vault_program: solana_program::pubkey::Pubkey, @@ -262,14 +292,20 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { self.token_vault_program = Some(token_vault_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + #[inline(always)] pub fn mint_new_edition_from_master_edition_via_token_args( &mut self, mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, @@ -518,6 +554,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { ); Self { instruction } } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn new_metadata( &mut self, new_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -525,6 +563,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.new_metadata = Some(new_metadata); self } + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn new_edition( &mut self, new_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -532,6 +572,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.new_edition = Some(new_edition); self } + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'] + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -539,6 +581,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn new_mint( &mut self, new_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -546,6 +590,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.new_mint = Some(new_mint); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + #[inline(always)] pub fn edition_mark_pda( &mut self, edition_mark_pda: &'a solana_program::account_info::AccountInfo<'a>, @@ -553,6 +599,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.edition_mark_pda = Some(edition_mark_pda); self } + /// Mint authority of new mint + #[inline(always)] pub fn new_mint_authority( &mut self, new_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -560,10 +608,14 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.new_mint_authority = Some(new_mint_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Vault authority + #[inline(always)] pub fn vault_authority( &mut self, vault_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -571,6 +623,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.vault_authority = Some(vault_authority); self } + /// Safety deposit token store account + #[inline(always)] pub fn safety_deposit_store( &mut self, safety_deposit_store: &'a solana_program::account_info::AccountInfo<'a>, @@ -578,6 +632,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.safety_deposit_store = Some(safety_deposit_store); self } + /// Safety deposit box + #[inline(always)] pub fn safety_deposit_box( &mut self, safety_deposit_box: &'a solana_program::account_info::AccountInfo<'a>, @@ -585,10 +641,14 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.safety_deposit_box = Some(safety_deposit_box); self } + /// Vault + #[inline(always)] pub fn vault(&mut self, vault: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.vault = Some(vault); self } + /// Update authority info for new metadata + #[inline(always)] pub fn new_metadata_update_authority( &mut self, new_metadata_update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -596,6 +656,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.new_metadata_update_authority = Some(new_metadata_update_authority); self } + /// Master record metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -603,6 +665,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -610,6 +674,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// Token vault program + #[inline(always)] pub fn token_vault_program( &mut self, token_vault_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -617,6 +683,8 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.token_vault_program = Some(token_vault_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -624,10 +692,14 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + #[inline(always)] pub fn mint_new_edition_from_master_edition_via_token_args( &mut self, mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, diff --git a/clients/rust/src/generated/instructions/mint_v1.rs b/clients/rust/src/generated/instructions/mint_v1.rs index fba27d77..70ca0c92 100644 --- a/clients/rust/src/generated/instructions/mint_v1.rs +++ b/clients/rust/src/generated/instructions/mint_v1.rs @@ -202,34 +202,54 @@ impl MintV1Builder { pub fn new() -> Self { Self::default() } + /// Token or Associated Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// `[optional account]` + /// Owner of the token account + #[inline(always)] pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { self.token_owner = Some(token_owner); self } + /// Metadata account (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// (Mint or Update) authority + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Metadata delegate record + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -237,14 +257,20 @@ impl MintV1Builder { self.delegate_record = Some(delegate_record); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -252,6 +278,8 @@ impl MintV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -259,6 +287,8 @@ impl MintV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// SPL Associated Token Account program + #[inline(always)] pub fn spl_ata_program( &mut self, spl_ata_program: solana_program::pubkey::Pubkey, @@ -266,6 +296,9 @@ impl MintV1Builder { self.spl_ata_program = Some(spl_ata_program); self } + /// `[optional account]` + /// Token Authorization Rules program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -273,6 +306,9 @@ impl MintV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -280,10 +316,13 @@ impl MintV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -544,10 +583,15 @@ impl<'a> MintV1CpiBuilder<'a> { }); Self { instruction } } + /// Token or Associated Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// `[optional account]` + /// Owner of the token account + #[inline(always)] pub fn token_owner( &mut self, token_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -555,6 +599,8 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.token_owner = Some(token_owner); self } + /// Metadata account (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -562,6 +608,9 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -569,6 +618,9 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -576,10 +628,14 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// (Mint or Update) authority + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -587,6 +643,9 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Metadata delegate record + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -594,10 +653,14 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -605,6 +668,8 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -612,6 +677,8 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -619,6 +686,8 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// SPL Associated Token Account program + #[inline(always)] pub fn spl_ata_program( &mut self, spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -626,6 +695,9 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.spl_ata_program = Some(spl_ata_program); self } + /// `[optional account]` + /// Token Authorization Rules program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -633,6 +705,9 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -640,10 +715,13 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/print_v1.rs b/clients/rust/src/generated/instructions/print_v1.rs index b5358525..8b250990 100644 --- a/clients/rust/src/generated/instructions/print_v1.rs +++ b/clients/rust/src/generated/instructions/print_v1.rs @@ -187,6 +187,8 @@ impl PrintV1Builder { pub fn new() -> Self { Self::default() } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn edition_metadata( &mut self, edition_metadata: solana_program::pubkey::Pubkey, @@ -194,14 +196,20 @@ impl PrintV1Builder { self.edition_metadata = Some(edition_metadata); self } + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn edition_mint(&mut self, edition_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.edition_mint = Some(edition_mint); self } + /// Owner of the token account of new token + #[inline(always)] pub fn edition_token_account_owner( &mut self, edition_token_account_owner: solana_program::pubkey::Pubkey, @@ -209,6 +217,8 @@ impl PrintV1Builder { self.edition_token_account_owner = Some(edition_token_account_owner); self } + /// Token account of new token + #[inline(always)] pub fn edition_token_account( &mut self, edition_token_account: solana_program::pubkey::Pubkey, @@ -216,6 +226,8 @@ impl PrintV1Builder { self.edition_token_account = Some(edition_token_account); self } + /// Mint authority of new mint + #[inline(always)] pub fn edition_mint_authority( &mut self, edition_mint_authority: solana_program::pubkey::Pubkey, @@ -223,6 +235,9 @@ impl PrintV1Builder { self.edition_mint_authority = Some(edition_mint_authority); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn edition_token_record( &mut self, edition_token_record: solana_program::pubkey::Pubkey, @@ -230,10 +245,14 @@ impl PrintV1Builder { self.edition_token_record = Some(edition_token_record); self } + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + #[inline(always)] pub fn edition_marker_pda( &mut self, edition_marker_pda: solana_program::pubkey::Pubkey, @@ -241,10 +260,14 @@ impl PrintV1Builder { self.edition_marker_pda = Some(edition_marker_pda); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// owner of token account containing master token + #[inline(always)] pub fn master_token_account_owner( &mut self, master_token_account_owner: solana_program::pubkey::Pubkey, @@ -252,6 +275,8 @@ impl PrintV1Builder { self.master_token_account_owner = Some(master_token_account_owner); self } + /// token account containing token from master metadata mint + #[inline(always)] pub fn master_token_account( &mut self, master_token_account: solana_program::pubkey::Pubkey, @@ -259,6 +284,8 @@ impl PrintV1Builder { self.master_token_account = Some(master_token_account); self } + /// Master record metadata account + #[inline(always)] pub fn master_metadata( &mut self, master_metadata: solana_program::pubkey::Pubkey, @@ -266,6 +293,8 @@ impl PrintV1Builder { self.master_metadata = Some(master_metadata); self } + /// The update authority of the master edition. + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -273,6 +302,8 @@ impl PrintV1Builder { self.update_authority = Some(update_authority); self } + /// Token program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -280,6 +311,8 @@ impl PrintV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// SPL Associated Token Account program + #[inline(always)] pub fn spl_ata_program( &mut self, spl_ata_program: solana_program::pubkey::Pubkey, @@ -287,6 +320,8 @@ impl PrintV1Builder { self.spl_ata_program = Some(spl_ata_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -294,10 +329,13 @@ impl PrintV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + #[inline(always)] pub fn edition_arg(&mut self, edition_arg: u64) -> &mut Self { self.edition_arg = Some(edition_arg); self @@ -553,6 +591,8 @@ impl<'a> PrintV1CpiBuilder<'a> { }); Self { instruction } } + /// New Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn edition_metadata( &mut self, edition_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -560,6 +600,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_metadata = Some(edition_metadata); self } + /// New Edition (pda of ['metadata', program id, mint id, 'edition']) + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,6 +609,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY + #[inline(always)] pub fn edition_mint( &mut self, edition_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +618,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_mint = Some(edition_mint); self } + /// Owner of the token account of new token + #[inline(always)] pub fn edition_token_account_owner( &mut self, edition_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +627,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_token_account_owner = Some(edition_token_account_owner); self } + /// Token account of new token + #[inline(always)] pub fn edition_token_account( &mut self, edition_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +636,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_token_account = Some(edition_token_account); self } + /// Mint authority of new mint + #[inline(always)] pub fn edition_mint_authority( &mut self, edition_mint_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +645,9 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_mint_authority = Some(edition_mint_authority); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn edition_token_record( &mut self, edition_token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -602,6 +655,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_token_record = Some(edition_token_record); self } + /// Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -609,6 +664,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). + #[inline(always)] pub fn edition_marker_pda( &mut self, edition_marker_pda: &'a solana_program::account_info::AccountInfo<'a>, @@ -616,10 +673,14 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.edition_marker_pda = Some(edition_marker_pda); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// owner of token account containing master token + #[inline(always)] pub fn master_token_account_owner( &mut self, master_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -627,6 +688,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.master_token_account_owner = Some(master_token_account_owner); self } + /// token account containing token from master metadata mint + #[inline(always)] pub fn master_token_account( &mut self, master_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -634,6 +697,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.master_token_account = Some(master_token_account); self } + /// Master record metadata account + #[inline(always)] pub fn master_metadata( &mut self, master_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -641,6 +706,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.master_metadata = Some(master_metadata); self } + /// The update authority of the master edition. + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -648,6 +715,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// Token program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -655,6 +724,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// SPL Associated Token Account program + #[inline(always)] pub fn spl_ata_program( &mut self, spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -662,6 +733,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.spl_ata_program = Some(spl_ata_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -669,6 +742,8 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -676,6 +751,7 @@ impl<'a> PrintV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + #[inline(always)] pub fn edition_arg(&mut self, edition_arg: u64) -> &mut Self { self.instruction.edition_arg = Some(edition_arg); self diff --git a/clients/rust/src/generated/instructions/puff_metadata.rs b/clients/rust/src/generated/instructions/puff_metadata.rs index 92d671fb..9a890420 100644 --- a/clients/rust/src/generated/instructions/puff_metadata.rs +++ b/clients/rust/src/generated/instructions/puff_metadata.rs @@ -54,6 +54,8 @@ impl PuffMetadataBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self @@ -124,6 +126,8 @@ impl<'a> PuffMetadataCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/remove_creator_verification.rs b/clients/rust/src/generated/instructions/remove_creator_verification.rs index 32aaa727..c48c5a23 100644 --- a/clients/rust/src/generated/instructions/remove_creator_verification.rs +++ b/clients/rust/src/generated/instructions/remove_creator_verification.rs @@ -61,10 +61,14 @@ impl RemoveCreatorVerificationBuilder { pub fn new() -> Self { Self::default() } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Creator + #[inline(always)] pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self { self.creator = Some(creator); self @@ -144,6 +148,8 @@ impl<'a> RemoveCreatorVerificationCpiBuilder<'a> { }); Self { instruction } } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -151,6 +157,8 @@ impl<'a> RemoveCreatorVerificationCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Creator + #[inline(always)] pub fn creator( &mut self, creator: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs index e804416e..48c3e949 100644 --- a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs @@ -193,6 +193,9 @@ impl RevokeAuthorityItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeAuthorityItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeAuthorityItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeAuthorityItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeAuthorityItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeAuthorityItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_collection_authority.rs b/clients/rust/src/generated/instructions/revoke_collection_authority.rs index fd0f555b..05cf84cd 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_authority.rs @@ -81,6 +81,8 @@ impl RevokeCollectionAuthorityBuilder { pub fn new() -> Self { Self::default() } + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -88,6 +90,8 @@ impl RevokeCollectionAuthorityBuilder { self.collection_authority_record = Some(collection_authority_record); self } + /// Delegated Collection Authority + #[inline(always)] pub fn delegate_authority( &mut self, delegate_authority: solana_program::pubkey::Pubkey, @@ -95,6 +99,8 @@ impl RevokeCollectionAuthorityBuilder { self.delegate_authority = Some(delegate_authority); self } + /// Update Authority, or Delegated Authority, of Collection NFT + #[inline(always)] pub fn revoke_authority( &mut self, revoke_authority: solana_program::pubkey::Pubkey, @@ -102,10 +108,14 @@ impl RevokeCollectionAuthorityBuilder { self.revoke_authority = Some(revoke_authority); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint of Metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self @@ -216,6 +226,8 @@ impl<'a> RevokeCollectionAuthorityCpiBuilder<'a> { }); Self { instruction } } + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -223,6 +235,8 @@ impl<'a> RevokeCollectionAuthorityCpiBuilder<'a> { self.instruction.collection_authority_record = Some(collection_authority_record); self } + /// Delegated Collection Authority + #[inline(always)] pub fn delegate_authority( &mut self, delegate_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -230,6 +244,8 @@ impl<'a> RevokeCollectionAuthorityCpiBuilder<'a> { self.instruction.delegate_authority = Some(delegate_authority); self } + /// Update Authority, or Delegated Authority, of Collection NFT + #[inline(always)] pub fn revoke_authority( &mut self, revoke_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -237,6 +253,8 @@ impl<'a> RevokeCollectionAuthorityCpiBuilder<'a> { self.instruction.revoke_authority = Some(revoke_authority); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -244,6 +262,8 @@ impl<'a> RevokeCollectionAuthorityCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint of Metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self diff --git a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs index 8f9dd9d7..e4c7c345 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs @@ -193,6 +193,9 @@ impl RevokeCollectionItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeCollectionItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeCollectionItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeCollectionItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeCollectionItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeCollectionItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_collection_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_v1.rs index d739be78..0496db12 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_v1.rs @@ -193,6 +193,9 @@ impl RevokeCollectionV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeCollectionV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeCollectionV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeCollectionV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeCollectionV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeCollectionV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs index 5b71c8d5..b661d1c9 100644 --- a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs @@ -193,6 +193,9 @@ impl RevokeDataItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeDataItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeDataItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeDataItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeDataItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeDataItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_data_v1.rs b/clients/rust/src/generated/instructions/revoke_data_v1.rs index 59f8b920..6a3bb6f7 100644 --- a/clients/rust/src/generated/instructions/revoke_data_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_v1.rs @@ -193,6 +193,9 @@ impl RevokeDataV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeDataV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeDataV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeDataV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeDataV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeDataV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs index e610db9c..7bf02428 100644 --- a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs @@ -188,6 +188,9 @@ impl RevokeLockedTransferV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeLockedTransferV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeLockedTransferV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeLockedTransferV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeLockedTransferV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeLockedTransferV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_migration_v1.rs b/clients/rust/src/generated/instructions/revoke_migration_v1.rs index fe8ba090..01ab5943 100644 --- a/clients/rust/src/generated/instructions/revoke_migration_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_migration_v1.rs @@ -188,6 +188,9 @@ impl RevokeMigrationV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeMigrationV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeMigrationV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeMigrationV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeMigrationV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeMigrationV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs index 6304ba36..6035a956 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs @@ -193,6 +193,9 @@ impl RevokeProgrammableConfigItemV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeProgrammableConfigItemV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeProgrammableConfigItemV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeProgrammableConfigItemV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeProgrammableConfigItemV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeProgrammableConfigItemV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs index 630eba03..9cb13ea6 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs @@ -193,6 +193,9 @@ impl RevokeProgrammableConfigV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -200,42 +203,65 @@ impl RevokeProgrammableConfigV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -243,6 +269,9 @@ impl RevokeProgrammableConfigV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -250,6 +279,9 @@ impl RevokeProgrammableConfigV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -257,6 +289,9 @@ impl RevokeProgrammableConfigV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -513,6 +548,9 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -520,6 +558,8 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -527,6 +567,8 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -534,6 +576,9 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -541,6 +586,9 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -548,14 +596,21 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,10 +618,14 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -574,6 +633,8 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -581,6 +642,9 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +652,9 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +662,9 @@ impl<'a> RevokeProgrammableConfigV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_sale_v1.rs b/clients/rust/src/generated/instructions/revoke_sale_v1.rs index fa87e869..ef3f4aac 100644 --- a/clients/rust/src/generated/instructions/revoke_sale_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_sale_v1.rs @@ -188,6 +188,9 @@ impl RevokeSaleV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeSaleV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeSaleV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeSaleV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeSaleV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeSaleV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_staking_v1.rs b/clients/rust/src/generated/instructions/revoke_staking_v1.rs index 76fb340d..eb26ee86 100644 --- a/clients/rust/src/generated/instructions/revoke_staking_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_staking_v1.rs @@ -188,6 +188,9 @@ impl RevokeStakingV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeStakingV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeStakingV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeStakingV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeStakingV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeStakingV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_standard_v1.rs b/clients/rust/src/generated/instructions/revoke_standard_v1.rs index f2b8ce9b..db24484d 100644 --- a/clients/rust/src/generated/instructions/revoke_standard_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_standard_v1.rs @@ -188,6 +188,9 @@ impl RevokeStandardV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeStandardV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeStandardV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeStandardV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeStandardV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeStandardV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs index 9cdb21af..5decc136 100644 --- a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs @@ -188,6 +188,9 @@ impl RevokeTransferV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeTransferV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeTransferV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeTransferV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeTransferV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeTransferV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/revoke_use_authority.rs b/clients/rust/src/generated/instructions/revoke_use_authority.rs index 7375d982..d5e37c5d 100644 --- a/clients/rust/src/generated/instructions/revoke_use_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_use_authority.rs @@ -113,6 +113,8 @@ impl RevokeUseAuthorityBuilder { pub fn new() -> Self { Self::default() } + /// Use Authority Record PDA + #[inline(always)] pub fn use_authority_record( &mut self, use_authority_record: solana_program::pubkey::Pubkey, @@ -120,14 +122,20 @@ impl RevokeUseAuthorityBuilder { self.use_authority_record = Some(use_authority_record); self } + /// Owner + #[inline(always)] pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { self.owner = Some(owner); self } + /// A Use Authority + #[inline(always)] pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self { self.user = Some(user); self } + /// Owned Token Account Of Mint + #[inline(always)] pub fn owner_token_account( &mut self, owner_token_account: solana_program::pubkey::Pubkey, @@ -135,22 +143,33 @@ impl RevokeUseAuthorityBuilder { self.owner_token_account = Some(owner_token_account); self } + /// Mint of Metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self @@ -309,6 +328,8 @@ impl<'a> RevokeUseAuthorityCpiBuilder<'a> { }); Self { instruction } } + /// Use Authority Record PDA + #[inline(always)] pub fn use_authority_record( &mut self, use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -316,14 +337,20 @@ impl<'a> RevokeUseAuthorityCpiBuilder<'a> { self.instruction.use_authority_record = Some(use_authority_record); self } + /// Owner + #[inline(always)] pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.owner = Some(owner); self } + /// A Use Authority + #[inline(always)] pub fn user(&mut self, user: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.user = Some(user); self } + /// Owned Token Account Of Mint + #[inline(always)] pub fn owner_token_account( &mut self, owner_token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -331,10 +358,14 @@ impl<'a> RevokeUseAuthorityCpiBuilder<'a> { self.instruction.owner_token_account = Some(owner_token_account); self } + /// Mint of Metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -342,6 +373,8 @@ impl<'a> RevokeUseAuthorityCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -349,6 +382,8 @@ impl<'a> RevokeUseAuthorityCpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -356,6 +391,9 @@ impl<'a> RevokeUseAuthorityCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// `[optional account]` + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self diff --git a/clients/rust/src/generated/instructions/revoke_utility_v1.rs b/clients/rust/src/generated/instructions/revoke_utility_v1.rs index 3fd403e3..a963e078 100644 --- a/clients/rust/src/generated/instructions/revoke_utility_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_utility_v1.rs @@ -188,6 +188,9 @@ impl RevokeUtilityV1Builder { pub fn new() -> Self { Self::default() } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -195,42 +198,64 @@ impl RevokeUtilityV1Builder { self.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition(&mut self, master_edition: solana_program::pubkey::Pubkey) -> &mut Self { self.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -238,6 +263,9 @@ impl RevokeUtilityV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -245,6 +273,9 @@ impl RevokeUtilityV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -252,6 +283,9 @@ impl RevokeUtilityV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -500,6 +534,9 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { }); Self { instruction } } + /// `[optional account]` + /// Delegate record account + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +544,8 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Owner of the delegated account + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +553,8 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +562,9 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Master Edition account + #[inline(always)] pub fn master_edition( &mut self, master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,6 +572,9 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.master_edition = Some(master_edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -535,14 +582,20 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Mint of metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token account of mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Update authority or token owner + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -550,10 +603,14 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +618,8 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +627,9 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,6 +637,9 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -582,6 +647,9 @@ impl<'a> RevokeUtilityV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/set_and_verify_collection.rs b/clients/rust/src/generated/instructions/set_and_verify_collection.rs index 019df651..74b07adf 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_collection.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_collection.rs @@ -109,10 +109,14 @@ impl SetAndVerifyCollectionBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -120,10 +124,14 @@ impl SetAndVerifyCollectionBuilder { self.collection_authority = Some(collection_authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Update Authority of Collection NFT and NFT + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -131,6 +139,8 @@ impl SetAndVerifyCollectionBuilder { self.update_authority = Some(update_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -138,10 +148,14 @@ impl SetAndVerifyCollectionBuilder { self.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { self.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: solana_program::pubkey::Pubkey, @@ -149,6 +163,9 @@ impl SetAndVerifyCollectionBuilder { self.collection_master_edition_account = Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -298,6 +315,8 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -305,6 +324,8 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -312,10 +333,14 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Update Authority of Collection NFT and NFT + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -323,6 +348,8 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -330,6 +357,8 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection( &mut self, collection: &'a solana_program::account_info::AccountInfo<'a>, @@ -337,6 +366,8 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { self.instruction.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -345,6 +376,9 @@ impl<'a> SetAndVerifyCollectionCpiBuilder<'a> { Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs index de5bc086..08d0547f 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs @@ -109,10 +109,14 @@ impl SetAndVerifySizedCollectionItemBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -120,10 +124,14 @@ impl SetAndVerifySizedCollectionItemBuilder { self.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Update Authority of Collection NFT and NFT + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -131,6 +139,8 @@ impl SetAndVerifySizedCollectionItemBuilder { self.update_authority = Some(update_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -138,10 +148,14 @@ impl SetAndVerifySizedCollectionItemBuilder { self.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { self.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: solana_program::pubkey::Pubkey, @@ -149,6 +163,9 @@ impl SetAndVerifySizedCollectionItemBuilder { self.collection_master_edition_account = Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -298,6 +315,8 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -305,6 +324,8 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -312,10 +333,14 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Update Authority of Collection NFT and NFT + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -323,6 +348,8 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -330,6 +357,8 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection( &mut self, collection: &'a solana_program::account_info::AccountInfo<'a>, @@ -337,6 +366,8 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -345,6 +376,9 @@ impl<'a> SetAndVerifySizedCollectionItemCpiBuilder<'a> { Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/set_collection_size.rs b/clients/rust/src/generated/instructions/set_collection_size.rs index 41e92060..928126b8 100644 --- a/clients/rust/src/generated/instructions/set_collection_size.rs +++ b/clients/rust/src/generated/instructions/set_collection_size.rs @@ -89,6 +89,8 @@ impl SetCollectionSizeBuilder { pub fn new() -> Self { Self::default() } + /// Collection Metadata account + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -96,6 +98,8 @@ impl SetCollectionSizeBuilder { self.collection_metadata = Some(collection_metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -103,6 +107,8 @@ impl SetCollectionSizeBuilder { self.collection_authority = Some(collection_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -110,6 +116,9 @@ impl SetCollectionSizeBuilder { self.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -117,6 +126,7 @@ impl SetCollectionSizeBuilder { self.collection_authority_record = Some(collection_authority_record); self } + #[inline(always)] pub fn set_collection_size_args( &mut self, set_collection_size_args: SetCollectionSizeArgs, @@ -236,6 +246,8 @@ impl<'a> SetCollectionSizeCpiBuilder<'a> { }); Self { instruction } } + /// Collection Metadata account + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -243,6 +255,8 @@ impl<'a> SetCollectionSizeCpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -250,6 +264,8 @@ impl<'a> SetCollectionSizeCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -257,6 +273,9 @@ impl<'a> SetCollectionSizeCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -264,6 +283,7 @@ impl<'a> SetCollectionSizeCpiBuilder<'a> { self.instruction.collection_authority_record = Some(collection_authority_record); self } + #[inline(always)] pub fn set_collection_size_args( &mut self, set_collection_size_args: SetCollectionSizeArgs, diff --git a/clients/rust/src/generated/instructions/set_token_standard.rs b/clients/rust/src/generated/instructions/set_token_standard.rs index 539d3f51..ca0dd919 100644 --- a/clients/rust/src/generated/instructions/set_token_standard.rs +++ b/clients/rust/src/generated/instructions/set_token_standard.rs @@ -80,10 +80,14 @@ impl SetTokenStandardBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Metadata update authority + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -91,10 +95,15 @@ impl SetTokenStandardBuilder { self.update_authority = Some(update_authority); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self @@ -201,6 +210,8 @@ impl<'a> SetTokenStandardCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -208,6 +219,8 @@ impl<'a> SetTokenStandardCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Metadata update authority + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -215,10 +228,15 @@ impl<'a> SetTokenStandardCpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/sign_metadata.rs b/clients/rust/src/generated/instructions/sign_metadata.rs index be3b4a7c..755e8fd5 100644 --- a/clients/rust/src/generated/instructions/sign_metadata.rs +++ b/clients/rust/src/generated/instructions/sign_metadata.rs @@ -61,10 +61,14 @@ impl SignMetadataBuilder { pub fn new() -> Self { Self::default() } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Creator + #[inline(always)] pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self { self.creator = Some(creator); self @@ -144,6 +148,8 @@ impl<'a> SignMetadataCpiBuilder<'a> { }); Self { instruction } } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -151,6 +157,8 @@ impl<'a> SignMetadataCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Creator + #[inline(always)] pub fn creator( &mut self, creator: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/thaw_delegated_account.rs b/clients/rust/src/generated/instructions/thaw_delegated_account.rs index 4020906c..0a001782 100644 --- a/clients/rust/src/generated/instructions/thaw_delegated_account.rs +++ b/clients/rust/src/generated/instructions/thaw_delegated_account.rs @@ -81,22 +81,32 @@ impl ThawDelegatedAccountBuilder { pub fn new() -> Self { Self::default() } + /// Delegate + #[inline(always)] pub fn delegate(&mut self, delegate: solana_program::pubkey::Pubkey) -> &mut Self { self.delegate = Some(delegate); self } + /// Token account to thaw + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// Edition + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Token mint + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Token Program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self @@ -205,6 +215,8 @@ impl<'a> ThawDelegatedAccountCpiBuilder<'a> { }); Self { instruction } } + /// Delegate + #[inline(always)] pub fn delegate( &mut self, delegate: &'a solana_program::account_info::AccountInfo<'a>, @@ -212,6 +224,8 @@ impl<'a> ThawDelegatedAccountCpiBuilder<'a> { self.instruction.delegate = Some(delegate); self } + /// Token account to thaw + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -219,6 +233,8 @@ impl<'a> ThawDelegatedAccountCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// Edition + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -226,10 +242,14 @@ impl<'a> ThawDelegatedAccountCpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Token mint + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Token Program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs index 480c2a77..5a7dab91 100644 --- a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs +++ b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs @@ -148,50 +148,74 @@ impl TransferOutOfEscrowBuilder { pub fn new() -> Self { Self::default() } + /// Escrow account + #[inline(always)] pub fn escrow(&mut self, escrow: solana_program::pubkey::Pubkey) -> &mut Self { self.escrow = Some(escrow); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Wallet paying for the transaction and new account + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Mint account for the new attribute + #[inline(always)] pub fn attribute_mint(&mut self, attribute_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.attribute_mint = Some(attribute_mint); self } + /// Token account source for the new attribute + #[inline(always)] pub fn attribute_src(&mut self, attribute_src: solana_program::pubkey::Pubkey) -> &mut Self { self.attribute_src = Some(attribute_src); self } + /// Token account, owned by TM, destination for the new attribute + #[inline(always)] pub fn attribute_dst(&mut self, attribute_dst: solana_program::pubkey::Pubkey) -> &mut Self { self.attribute_dst = Some(attribute_dst); self } + /// Mint account that the escrow is attached + #[inline(always)] pub fn escrow_mint(&mut self, escrow_mint: solana_program::pubkey::Pubkey) -> &mut Self { self.escrow_mint = Some(escrow_mint); self } + /// Token account that holds the token the escrow is attached to + #[inline(always)] pub fn escrow_account(&mut self, escrow_account: solana_program::pubkey::Pubkey) -> &mut Self { self.escrow_account = Some(escrow_account); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Associated Token program + #[inline(always)] pub fn ata_program(&mut self, ata_program: solana_program::pubkey::Pubkey) -> &mut Self { self.ata_program = Some(ata_program); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -199,10 +223,14 @@ impl TransferOutOfEscrowBuilder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Authority/creator of the escrow account + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self @@ -399,6 +427,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { }); Self { instruction } } + /// Escrow account + #[inline(always)] pub fn escrow( &mut self, escrow: &'a solana_program::account_info::AccountInfo<'a>, @@ -406,6 +436,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.escrow = Some(escrow); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -413,10 +445,14 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Wallet paying for the transaction and new account + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Mint account for the new attribute + #[inline(always)] pub fn attribute_mint( &mut self, attribute_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -424,6 +460,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.attribute_mint = Some(attribute_mint); self } + /// Token account source for the new attribute + #[inline(always)] pub fn attribute_src( &mut self, attribute_src: &'a solana_program::account_info::AccountInfo<'a>, @@ -431,6 +469,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.attribute_src = Some(attribute_src); self } + /// Token account, owned by TM, destination for the new attribute + #[inline(always)] pub fn attribute_dst( &mut self, attribute_dst: &'a solana_program::account_info::AccountInfo<'a>, @@ -438,6 +478,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.attribute_dst = Some(attribute_dst); self } + /// Mint account that the escrow is attached + #[inline(always)] pub fn escrow_mint( &mut self, escrow_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -445,6 +487,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.escrow_mint = Some(escrow_mint); self } + /// Token account that holds the token the escrow is attached to + #[inline(always)] pub fn escrow_account( &mut self, escrow_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -452,6 +496,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.escrow_account = Some(escrow_account); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -459,6 +505,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Associated Token program + #[inline(always)] pub fn ata_program( &mut self, ata_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -466,6 +514,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.ata_program = Some(ata_program); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -473,6 +523,8 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -480,6 +532,9 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Authority/creator of the escrow account + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -487,6 +542,7 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.authority = Some(authority); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self diff --git a/clients/rust/src/generated/instructions/transfer_v1.rs b/clients/rust/src/generated/instructions/transfer_v1.rs index 1ae7a3bf..7e88c76b 100644 --- a/clients/rust/src/generated/instructions/transfer_v1.rs +++ b/clients/rust/src/generated/instructions/transfer_v1.rs @@ -208,14 +208,20 @@ impl TransferV1Builder { pub fn new() -> Self { Self::default() } + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Token account owner + #[inline(always)] pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { self.token_owner = Some(token_owner); self } + /// Destination token account + #[inline(always)] pub fn destination_token( &mut self, destination_token: solana_program::pubkey::Pubkey, @@ -223,6 +229,8 @@ impl TransferV1Builder { self.destination_token = Some(destination_token); self } + /// Destination token account owner + #[inline(always)] pub fn destination_owner( &mut self, destination_owner: solana_program::pubkey::Pubkey, @@ -230,22 +238,35 @@ impl TransferV1Builder { self.destination_owner = Some(destination_owner); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition of token asset + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// `[optional account]` + /// Owner token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// `[optional account]` + /// Destination token record account + #[inline(always)] pub fn destination_token_record( &mut self, destination_token_record: solana_program::pubkey::Pubkey, @@ -253,18 +274,26 @@ impl TransferV1Builder { self.destination_token_record = Some(destination_token_record); self } + /// Transfer authority (token owner or delegate) + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -272,6 +301,8 @@ impl TransferV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -279,6 +310,8 @@ impl TransferV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// SPL Associated Token Account program + #[inline(always)] pub fn spl_ata_program( &mut self, spl_ata_program: solana_program::pubkey::Pubkey, @@ -286,6 +319,9 @@ impl TransferV1Builder { self.spl_ata_program = Some(spl_ata_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -293,6 +329,9 @@ impl TransferV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -300,10 +339,13 @@ impl TransferV1Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -577,10 +619,14 @@ impl<'a> TransferV1CpiBuilder<'a> { }); Self { instruction } } + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Token account owner + #[inline(always)] pub fn token_owner( &mut self, token_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -588,6 +634,8 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.token_owner = Some(token_owner); self } + /// Destination token account + #[inline(always)] pub fn destination_token( &mut self, destination_token: &'a solana_program::account_info::AccountInfo<'a>, @@ -595,6 +643,8 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.destination_token = Some(destination_token); self } + /// Destination token account owner + #[inline(always)] pub fn destination_owner( &mut self, destination_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -602,10 +652,14 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.destination_owner = Some(destination_owner); self } + /// Mint of token asset + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -613,6 +667,9 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition of token asset + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -620,6 +677,9 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// `[optional account]` + /// Owner token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -627,6 +687,9 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// `[optional account]` + /// Destination token record account + #[inline(always)] pub fn destination_token_record( &mut self, destination_token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -634,6 +697,8 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.destination_token_record = Some(destination_token_record); self } + /// Transfer authority (token owner or delegate) + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -641,10 +706,14 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System Program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -652,6 +721,8 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -659,6 +730,8 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -666,6 +739,8 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// SPL Associated Token Account program + #[inline(always)] pub fn spl_ata_program( &mut self, spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -673,6 +748,9 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.spl_ata_program = Some(spl_ata_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -680,6 +758,9 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -687,10 +768,13 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/unlock_v1.rs b/clients/rust/src/generated/instructions/unlock_v1.rs index c3e16f33..8a3c46e6 100644 --- a/clients/rust/src/generated/instructions/unlock_v1.rs +++ b/clients/rust/src/generated/instructions/unlock_v1.rs @@ -184,42 +184,65 @@ impl UnlockV1Builder { pub fn new() -> Self { Self::default() } + /// Delegate or freeze authority + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Token owner account + #[inline(always)] pub fn token_owner(&mut self, token_owner: solana_program::pubkey::Pubkey) -> &mut Self { self.token_owner = Some(token_owner); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record(&mut self, token_record: solana_program::pubkey::Pubkey) -> &mut Self { self.token_record = Some(token_record); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// System program + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -227,6 +250,9 @@ impl UnlockV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -234,6 +260,9 @@ impl UnlockV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -241,6 +270,9 @@ impl UnlockV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -248,6 +280,8 @@ impl UnlockV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -485,6 +519,8 @@ impl<'a> UnlockV1CpiBuilder<'a> { }); Self { instruction } } + /// Delegate or freeze authority + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -492,6 +528,9 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Token owner account + #[inline(always)] pub fn token_owner( &mut self, token_owner: &'a solana_program::account_info::AccountInfo<'a>, @@ -499,14 +538,20 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.token_owner = Some(token_owner); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +559,9 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,6 +569,9 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// `[optional account]` + /// Token record account + #[inline(always)] pub fn token_record( &mut self, token_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -528,10 +579,14 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.token_record = Some(token_record); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -539,6 +594,8 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// System program + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -546,6 +603,9 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -553,6 +613,9 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -560,6 +623,9 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -567,6 +633,8 @@ impl<'a> UnlockV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/unverify_collection.rs b/clients/rust/src/generated/instructions/unverify_collection.rs index d3c444da..1cf4edf3 100644 --- a/clients/rust/src/generated/instructions/unverify_collection.rs +++ b/clients/rust/src/generated/instructions/unverify_collection.rs @@ -96,10 +96,14 @@ impl UnverifyCollectionBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Collection Authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -107,6 +111,8 @@ impl UnverifyCollectionBuilder { self.collection_authority = Some(collection_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -114,10 +120,14 @@ impl UnverifyCollectionBuilder { self.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { self.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: solana_program::pubkey::Pubkey, @@ -125,6 +135,9 @@ impl UnverifyCollectionBuilder { self.collection_master_edition_account = Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -256,6 +269,8 @@ impl<'a> UnverifyCollectionCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -263,6 +278,8 @@ impl<'a> UnverifyCollectionCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Collection Authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -270,6 +287,8 @@ impl<'a> UnverifyCollectionCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -277,6 +296,8 @@ impl<'a> UnverifyCollectionCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection( &mut self, collection: &'a solana_program::account_info::AccountInfo<'a>, @@ -284,6 +305,8 @@ impl<'a> UnverifyCollectionCpiBuilder<'a> { self.instruction.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -292,6 +315,9 @@ impl<'a> UnverifyCollectionCpiBuilder<'a> { Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/unverify_collection_v1.rs b/clients/rust/src/generated/instructions/unverify_collection_v1.rs index a24883b3..35365b37 100644 --- a/clients/rust/src/generated/instructions/unverify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_collection_v1.rs @@ -114,10 +114,15 @@ impl UnverifyCollectionV1Builder { pub fn new() -> Self { Self::default() } + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -125,10 +130,14 @@ impl UnverifyCollectionV1Builder { self.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -136,6 +145,9 @@ impl UnverifyCollectionV1Builder { self.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -143,10 +155,14 @@ impl UnverifyCollectionV1Builder { self.collection_metadata = Some(collection_metadata); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -296,6 +312,8 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { }); Self { instruction } } + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -303,6 +321,9 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -310,6 +331,8 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -317,6 +340,8 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -324,6 +349,9 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -331,6 +359,8 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -338,6 +368,8 @@ impl<'a> UnverifyCollectionV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/unverify_creator_v1.rs b/clients/rust/src/generated/instructions/unverify_creator_v1.rs index 587941f1..06874b3f 100644 --- a/clients/rust/src/generated/instructions/unverify_creator_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_creator_v1.rs @@ -121,10 +121,15 @@ impl UnverifyCreatorV1Builder { pub fn new() -> Self { Self::default() } + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -132,10 +137,15 @@ impl UnverifyCreatorV1Builder { self.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -143,6 +153,9 @@ impl UnverifyCreatorV1Builder { self.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -150,10 +163,14 @@ impl UnverifyCreatorV1Builder { self.collection_metadata = Some(collection_metadata); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -312,6 +329,8 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { }); Self { instruction } } + /// Creator to verify, collection (or metadata if parent burned) update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -319,6 +338,9 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -326,6 +348,8 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -333,6 +357,9 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -340,6 +367,9 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -347,6 +377,8 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -354,6 +386,8 @@ impl<'a> UnverifyCreatorV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs index f58241f0..a97984c1 100644 --- a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs @@ -102,10 +102,14 @@ impl UnverifySizedCollectionItemBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Collection Authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -113,10 +117,14 @@ impl UnverifySizedCollectionItemBuilder { self.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -124,10 +132,14 @@ impl UnverifySizedCollectionItemBuilder { self.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { self.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: solana_program::pubkey::Pubkey, @@ -135,6 +147,9 @@ impl UnverifySizedCollectionItemBuilder { self.collection_master_edition_account = Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -275,6 +290,8 @@ impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -282,6 +299,8 @@ impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Collection Authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -289,10 +308,14 @@ impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -300,6 +323,8 @@ impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection( &mut self, collection: &'a solana_program::account_info::AccountInfo<'a>, @@ -307,6 +332,8 @@ impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -315,6 +342,9 @@ impl<'a> UnverifySizedCollectionItemCpiBuilder<'a> { Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs index 5d3b6b53..b2e60cc8 100644 --- a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs @@ -177,10 +177,15 @@ impl UpdateAsAuthorityItemDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -188,30 +193,46 @@ impl UpdateAsAuthorityItemDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -219,6 +240,9 @@ impl UpdateAsAuthorityItemDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -226,6 +250,9 @@ impl UpdateAsAuthorityItemDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -233,22 +260,32 @@ impl UpdateAsAuthorityItemDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); self } + /// `[optional argument]` + #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.token_standard = Some(token_standard); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -462,6 +499,8 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -469,6 +508,9 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -476,14 +518,21 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -491,6 +540,9 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -498,10 +550,14 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -509,6 +565,8 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -516,6 +574,9 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -523,6 +584,9 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -530,22 +594,32 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.instruction.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.instruction.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); self } + /// `[optional argument]` + #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.instruction.token_standard = Some(token_standard); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs index 87a0c62e..e6d6d9fc 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs @@ -167,10 +167,15 @@ impl UpdateAsCollectionDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -178,30 +183,46 @@ impl UpdateAsCollectionDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -209,6 +230,9 @@ impl UpdateAsCollectionDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -216,6 +240,9 @@ impl UpdateAsCollectionDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -223,10 +250,13 @@ impl UpdateAsCollectionDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -437,6 +467,8 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -444,6 +476,9 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -451,14 +486,21 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -466,6 +508,9 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -473,10 +518,14 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -484,6 +533,8 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -491,6 +542,9 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -498,6 +552,9 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -505,10 +562,13 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs index 97196dc1..a27d8c6c 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs @@ -167,10 +167,15 @@ impl UpdateAsCollectionItemDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -178,30 +183,46 @@ impl UpdateAsCollectionItemDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -209,6 +230,9 @@ impl UpdateAsCollectionItemDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -216,6 +240,9 @@ impl UpdateAsCollectionItemDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -223,10 +250,13 @@ impl UpdateAsCollectionItemDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -437,6 +467,8 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -444,6 +476,9 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -451,14 +486,21 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -466,6 +508,9 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -473,10 +518,14 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -484,6 +533,8 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -491,6 +542,9 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -498,6 +552,9 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -505,10 +562,13 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs index d06bccd6..9ad7c9c8 100644 --- a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs @@ -176,10 +176,15 @@ impl UpdateAsDataDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -187,30 +192,46 @@ impl UpdateAsDataDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -218,6 +239,9 @@ impl UpdateAsDataDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -225,6 +249,9 @@ impl UpdateAsDataDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -232,10 +259,14 @@ impl UpdateAsDataDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateAsDataDelegateV2InstructionDataData) -> &mut Self { self.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -446,6 +477,8 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -453,6 +486,9 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -460,14 +496,21 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -475,6 +518,9 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -482,10 +528,14 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -493,6 +543,8 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -500,6 +552,9 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +562,9 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,10 +572,14 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateAsDataDelegateV2InstructionDataData) -> &mut Self { self.instruction.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs index 0ccc1a3d..b7b36a4b 100644 --- a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs @@ -176,10 +176,15 @@ impl UpdateAsDataItemDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -187,30 +192,46 @@ impl UpdateAsDataItemDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -218,6 +239,9 @@ impl UpdateAsDataItemDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -225,6 +249,9 @@ impl UpdateAsDataItemDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -232,10 +259,14 @@ impl UpdateAsDataItemDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateAsDataItemDelegateV2InstructionDataData) -> &mut Self { self.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -446,6 +477,8 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -453,6 +486,9 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -460,14 +496,21 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -475,6 +518,9 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -482,10 +528,14 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -493,6 +543,8 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -500,6 +552,9 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -507,6 +562,9 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,10 +572,14 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateAsDataItemDelegateV2InstructionDataData) -> &mut Self { self.instruction.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs index 39640980..fc56df63 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs @@ -160,10 +160,15 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -171,30 +176,45 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -202,6 +222,9 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -209,6 +232,9 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -216,10 +242,13 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -422,6 +451,8 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -429,6 +460,9 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -436,14 +470,20 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -451,6 +491,9 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -458,10 +501,14 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -469,6 +516,8 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -476,6 +525,9 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -483,6 +535,9 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -490,10 +545,13 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs index f5e86778..aaad52ff 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs @@ -160,10 +160,15 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -171,30 +176,45 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { self.delegate_record = Some(delegate_record); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -202,6 +222,9 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -209,6 +232,9 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -216,10 +242,13 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -424,6 +453,8 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { ); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -431,6 +462,9 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -438,14 +472,20 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -453,6 +493,9 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -460,10 +503,14 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -471,6 +518,8 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -478,6 +527,9 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -485,6 +537,9 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -492,10 +547,13 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs index 2d696ba6..fc1c1231 100644 --- a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs @@ -206,10 +206,15 @@ impl UpdateAsUpdateAuthorityV2Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -217,30 +222,46 @@ impl UpdateAsUpdateAuthorityV2Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -248,6 +269,9 @@ impl UpdateAsUpdateAuthorityV2Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -255,6 +279,9 @@ impl UpdateAsUpdateAuthorityV2Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -262,42 +289,58 @@ impl UpdateAsUpdateAuthorityV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateAsUpdateAuthorityV2InstructionDataData) -> &mut Self { self.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); self } + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.collection_details = Some(collection_details); self } + #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.uses = Some(uses); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.token_standard = Some(token_standard); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -516,6 +559,8 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -523,6 +568,9 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -530,14 +578,21 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -545,6 +600,9 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -552,10 +610,14 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -563,6 +625,8 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -570,6 +634,9 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -577,6 +644,9 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -584,42 +654,58 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.instruction.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateAsUpdateAuthorityV2InstructionDataData) -> &mut Self { self.instruction.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.instruction.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); self } + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.instruction.collection_details = Some(collection_details); self } + #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.instruction.uses = Some(uses); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.instruction.token_standard = Some(token_standard); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs index e7073b1c..ba483728 100644 --- a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs +++ b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs @@ -77,10 +77,14 @@ impl UpdateMetadataAccountV2Builder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Update authority key + #[inline(always)] pub fn update_authority( &mut self, update_authority: solana_program::pubkey::Pubkey, @@ -88,18 +92,26 @@ impl UpdateMetadataAccountV2Builder { self.update_authority = Some(update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: DataV2) -> &mut Self { self.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); self @@ -183,6 +195,8 @@ impl<'a> UpdateMetadataAccountV2CpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -190,6 +204,8 @@ impl<'a> UpdateMetadataAccountV2CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Update authority key + #[inline(always)] pub fn update_authority( &mut self, update_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -197,18 +213,26 @@ impl<'a> UpdateMetadataAccountV2CpiBuilder<'a> { self.instruction.update_authority = Some(update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: DataV2) -> &mut Self { self.instruction.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.instruction.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.instruction.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); self diff --git a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs index a3763924..e31fc689 100644 --- a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs +++ b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs @@ -66,14 +66,20 @@ impl UpdatePrimarySaleHappenedViaTokenBuilder { pub fn new() -> Self { Self::default() } + /// Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Owner on the token account + #[inline(always)] pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { self.owner = Some(owner); self } + /// Account containing tokens from the metadata's mint + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self @@ -162,6 +168,8 @@ impl<'a> UpdatePrimarySaleHappenedViaTokenCpiBuilder<'a> { }); Self { instruction } } + /// Metadata key (pda of ['metadata', program id, mint id]) + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -169,10 +177,14 @@ impl<'a> UpdatePrimarySaleHappenedViaTokenCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Owner on the token account + #[inline(always)] pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.owner = Some(owner); self } + /// Account containing tokens from the metadata's mint + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self diff --git a/clients/rust/src/generated/instructions/update_v1.rs b/clients/rust/src/generated/instructions/update_v1.rs index 9a68d372..59cc5ded 100644 --- a/clients/rust/src/generated/instructions/update_v1.rs +++ b/clients/rust/src/generated/instructions/update_v1.rs @@ -202,10 +202,15 @@ impl UpdateV1Builder { pub fn new() -> Self { Self::default() } + /// Update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -213,30 +218,46 @@ impl UpdateV1Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -244,6 +265,9 @@ impl UpdateV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -251,6 +275,9 @@ impl UpdateV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -258,38 +285,52 @@ impl UpdateV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateV1InstructionDataData) -> &mut Self { self.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); self } + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.collection_details = Some(collection_details); self } + #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.uses = Some(uses); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -507,6 +548,8 @@ impl<'a> UpdateV1CpiBuilder<'a> { }); Self { instruction } } + /// Update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -514,6 +557,9 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -521,14 +567,21 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -536,6 +589,9 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -543,10 +599,14 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -554,6 +614,8 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -561,6 +623,9 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -568,6 +633,9 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -575,38 +643,52 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn new_update_authority(&mut self, new_update_authority: Pubkey) -> &mut Self { self.instruction.new_update_authority = Some(new_update_authority); self } + /// `[optional argument]` + #[inline(always)] pub fn data(&mut self, data: UpdateV1InstructionDataData) -> &mut Self { self.instruction.data = Some(data); self } + /// `[optional argument]` + #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.instruction.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument]` + #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); self } + #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); self } + #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.instruction.collection_details = Some(collection_details); self } + #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.instruction.uses = Some(uses); self } + #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/use_v1.rs b/clients/rust/src/generated/instructions/use_v1.rs index 4742e1ed..82c1b082 100644 --- a/clients/rust/src/generated/instructions/use_v1.rs +++ b/clients/rust/src/generated/instructions/use_v1.rs @@ -175,10 +175,15 @@ impl UseV1Builder { pub fn new() -> Self { Self::default() } + /// Token owner or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -186,30 +191,46 @@ impl UseV1Builder { self.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: solana_program::pubkey::Pubkey) -> &mut Self { self.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self { self.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// System program + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -217,6 +238,9 @@ impl UseV1Builder { self.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: solana_program::pubkey::Pubkey, @@ -224,6 +248,9 @@ impl UseV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: solana_program::pubkey::Pubkey, @@ -231,6 +258,9 @@ impl UseV1Builder { self.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: solana_program::pubkey::Pubkey, @@ -238,6 +268,8 @@ impl UseV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.authorization_data = Some(authorization_data); self @@ -465,6 +497,8 @@ impl<'a> UseV1CpiBuilder<'a> { }); Self { instruction } } + /// Token owner or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -472,6 +506,9 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -479,14 +516,21 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// `[optional account]` + /// Token account + #[inline(always)] pub fn token(&mut self, token: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.token = Some(token); self } + /// Mint account + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -494,6 +538,9 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Edition account + #[inline(always)] pub fn edition( &mut self, edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -501,10 +548,14 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.edition = Some(edition); self } + /// Payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -512,6 +563,8 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// System program + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, @@ -519,6 +572,9 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.sysvar_instructions = Some(sysvar_instructions); self } + /// `[optional account]` + /// SPL Token Program + #[inline(always)] pub fn spl_token_program( &mut self, spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -526,6 +582,9 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional account]` + /// Token Authorization Rules Program + #[inline(always)] pub fn authorization_rules_program( &mut self, authorization_rules_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -533,6 +592,9 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.authorization_rules_program = Some(authorization_rules_program); self } + /// `[optional account]` + /// Token Authorization Rules account + #[inline(always)] pub fn authorization_rules( &mut self, authorization_rules: &'a solana_program::account_info::AccountInfo<'a>, @@ -540,6 +602,8 @@ impl<'a> UseV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument]` + #[inline(always)] pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self { self.instruction.authorization_data = Some(authorization_data); self diff --git a/clients/rust/src/generated/instructions/utilize.rs b/clients/rust/src/generated/instructions/utilize.rs index eb347f18..210833ca 100644 --- a/clients/rust/src/generated/instructions/utilize.rs +++ b/clients/rust/src/generated/instructions/utilize.rs @@ -140,42 +140,63 @@ impl UtilizeBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Token Account Of NFT + #[inline(always)] pub fn token_account(&mut self, token_account: solana_program::pubkey::Pubkey) -> &mut Self { self.token_account = Some(token_account); self } + /// Mint of the Metadata + #[inline(always)] pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self { self.mint = Some(mint); self } + /// A Use Authority / Can be the current Owner of the NFT + #[inline(always)] pub fn use_authority(&mut self, use_authority: solana_program::pubkey::Pubkey) -> &mut Self { self.use_authority = Some(use_authority); self } + /// Owner + #[inline(always)] pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { self.owner = Some(owner); self } + /// Token program + #[inline(always)] pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self { self.token_program = Some(token_program); self } + /// Associated Token program + #[inline(always)] pub fn ata_program(&mut self, ata_program: solana_program::pubkey::Pubkey) -> &mut Self { self.ata_program = Some(ata_program); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self { self.rent = Some(rent); self } + /// `[optional account]` + /// Use Authority Record PDA If present the program Assumes a delegated use authority + #[inline(always)] pub fn use_authority_record( &mut self, use_authority_record: solana_program::pubkey::Pubkey, @@ -183,10 +204,14 @@ impl UtilizeBuilder { self.use_authority_record = Some(use_authority_record); self } + /// `[optional account]` + /// Program As Signer (Burner) + #[inline(always)] pub fn burner(&mut self, burner: solana_program::pubkey::Pubkey) -> &mut Self { self.burner = Some(burner); self } + #[inline(always)] pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { self.number_of_uses = Some(number_of_uses); self @@ -379,6 +404,8 @@ impl<'a> UtilizeCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -386,6 +413,8 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Token Account Of NFT + #[inline(always)] pub fn token_account( &mut self, token_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -393,10 +422,14 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.token_account = Some(token_account); self } + /// Mint of the Metadata + #[inline(always)] pub fn mint(&mut self, mint: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.mint = Some(mint); self } + /// A Use Authority / Can be the current Owner of the NFT + #[inline(always)] pub fn use_authority( &mut self, use_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -404,10 +437,14 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.use_authority = Some(use_authority); self } + /// Owner + #[inline(always)] pub fn owner(&mut self, owner: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.owner = Some(owner); self } + /// Token program + #[inline(always)] pub fn token_program( &mut self, token_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -415,6 +452,8 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.token_program = Some(token_program); self } + /// Associated Token program + #[inline(always)] pub fn ata_program( &mut self, ata_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -422,6 +461,8 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.ata_program = Some(ata_program); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -429,10 +470,15 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Rent info + #[inline(always)] pub fn rent(&mut self, rent: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.rent = Some(rent); self } + /// `[optional account]` + /// Use Authority Record PDA If present the program Assumes a delegated use authority + #[inline(always)] pub fn use_authority_record( &mut self, use_authority_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -440,6 +486,9 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.use_authority_record = Some(use_authority_record); self } + /// `[optional account]` + /// Program As Signer (Burner) + #[inline(always)] pub fn burner( &mut self, burner: &'a solana_program::account_info::AccountInfo<'a>, @@ -447,6 +496,7 @@ impl<'a> UtilizeCpiBuilder<'a> { self.instruction.burner = Some(burner); self } + #[inline(always)] pub fn number_of_uses(&mut self, number_of_uses: u64) -> &mut Self { self.instruction.number_of_uses = Some(number_of_uses); self diff --git a/clients/rust/src/generated/instructions/verify_collection.rs b/clients/rust/src/generated/instructions/verify_collection.rs index f3e124cd..2d9e1263 100644 --- a/clients/rust/src/generated/instructions/verify_collection.rs +++ b/clients/rust/src/generated/instructions/verify_collection.rs @@ -102,10 +102,14 @@ impl VerifyCollectionBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -113,10 +117,14 @@ impl VerifyCollectionBuilder { self.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -124,10 +132,14 @@ impl VerifyCollectionBuilder { self.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { self.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: solana_program::pubkey::Pubkey, @@ -135,6 +147,9 @@ impl VerifyCollectionBuilder { self.collection_master_edition_account = Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -275,6 +290,8 @@ impl<'a> VerifyCollectionCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -282,6 +299,8 @@ impl<'a> VerifyCollectionCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -289,10 +308,14 @@ impl<'a> VerifyCollectionCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -300,6 +323,8 @@ impl<'a> VerifyCollectionCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection( &mut self, collection: &'a solana_program::account_info::AccountInfo<'a>, @@ -307,6 +332,8 @@ impl<'a> VerifyCollectionCpiBuilder<'a> { self.instruction.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -315,6 +342,9 @@ impl<'a> VerifyCollectionCpiBuilder<'a> { Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/verify_collection_v1.rs b/clients/rust/src/generated/instructions/verify_collection_v1.rs index ec4bb06a..1bcc4d86 100644 --- a/clients/rust/src/generated/instructions/verify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/verify_collection_v1.rs @@ -128,10 +128,15 @@ impl VerifyCollectionV1Builder { pub fn new() -> Self { Self::default() } + /// Creator to verify, collection update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -139,10 +144,14 @@ impl VerifyCollectionV1Builder { self.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -150,6 +159,9 @@ impl VerifyCollectionV1Builder { self.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -157,6 +169,9 @@ impl VerifyCollectionV1Builder { self.collection_metadata = Some(collection_metadata); self } + /// `[optional account]` + /// Master Edition Account of the Collection Token + #[inline(always)] pub fn collection_master_edition( &mut self, collection_master_edition: solana_program::pubkey::Pubkey, @@ -164,10 +179,14 @@ impl VerifyCollectionV1Builder { self.collection_master_edition = Some(collection_master_edition); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -335,6 +354,8 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { }); Self { instruction } } + /// Creator to verify, collection update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -342,6 +363,9 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -349,6 +373,8 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -356,6 +382,8 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -363,6 +391,9 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -370,6 +401,9 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// `[optional account]` + /// Master Edition Account of the Collection Token + #[inline(always)] pub fn collection_master_edition( &mut self, collection_master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -377,6 +411,8 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.collection_master_edition = Some(collection_master_edition); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -384,6 +420,8 @@ impl<'a> VerifyCollectionV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/verify_creator_v1.rs b/clients/rust/src/generated/instructions/verify_creator_v1.rs index 4c6652d1..4652a80e 100644 --- a/clients/rust/src/generated/instructions/verify_creator_v1.rs +++ b/clients/rust/src/generated/instructions/verify_creator_v1.rs @@ -135,10 +135,15 @@ impl VerifyCreatorV1Builder { pub fn new() -> Self { Self::default() } + /// Creator to verify, collection update authority or delegate + #[inline(always)] pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: solana_program::pubkey::Pubkey, @@ -146,10 +151,15 @@ impl VerifyCreatorV1Builder { self.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// `[optional account]` + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -157,6 +167,9 @@ impl VerifyCreatorV1Builder { self.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: solana_program::pubkey::Pubkey, @@ -164,6 +177,9 @@ impl VerifyCreatorV1Builder { self.collection_metadata = Some(collection_metadata); self } + /// `[optional account]` + /// Master Edition Account of the Collection Token + #[inline(always)] pub fn collection_master_edition( &mut self, collection_master_edition: solana_program::pubkey::Pubkey, @@ -171,10 +187,14 @@ impl VerifyCreatorV1Builder { self.collection_master_edition = Some(collection_master_edition); self } + /// System program + #[inline(always)] pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self { self.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: solana_program::pubkey::Pubkey, @@ -351,6 +371,8 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { }); Self { instruction } } + /// Creator to verify, collection update authority or delegate + #[inline(always)] pub fn authority( &mut self, authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -358,6 +380,9 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional account]` + /// Delegate record PDA + #[inline(always)] pub fn delegate_record( &mut self, delegate_record: &'a solana_program::account_info::AccountInfo<'a>, @@ -365,6 +390,8 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.delegate_record = Some(delegate_record); self } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -372,6 +399,9 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// `[optional account]` + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -379,6 +409,9 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// `[optional account]` + /// Metadata Account of the Collection + #[inline(always)] pub fn collection_metadata( &mut self, collection_metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -386,6 +419,9 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.collection_metadata = Some(collection_metadata); self } + /// `[optional account]` + /// Master Edition Account of the Collection Token + #[inline(always)] pub fn collection_master_edition( &mut self, collection_master_edition: &'a solana_program::account_info::AccountInfo<'a>, @@ -393,6 +429,8 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.collection_master_edition = Some(collection_master_edition); self } + /// System program + #[inline(always)] pub fn system_program( &mut self, system_program: &'a solana_program::account_info::AccountInfo<'a>, @@ -400,6 +438,8 @@ impl<'a> VerifyCreatorV1CpiBuilder<'a> { self.instruction.system_program = Some(system_program); self } + /// Instructions sysvar account + #[inline(always)] pub fn sysvar_instructions( &mut self, sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs index cdf37b78..44112689 100644 --- a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs @@ -102,10 +102,14 @@ impl VerifySizedCollectionItemBuilder { pub fn new() -> Self { Self::default() } + /// Metadata account + #[inline(always)] pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self { self.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: solana_program::pubkey::Pubkey, @@ -113,10 +117,14 @@ impl VerifySizedCollectionItemBuilder { self.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: solana_program::pubkey::Pubkey, @@ -124,10 +132,14 @@ impl VerifySizedCollectionItemBuilder { self.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection(&mut self, collection: solana_program::pubkey::Pubkey) -> &mut Self { self.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: solana_program::pubkey::Pubkey, @@ -135,6 +147,9 @@ impl VerifySizedCollectionItemBuilder { self.collection_master_edition_account = Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: solana_program::pubkey::Pubkey, @@ -275,6 +290,8 @@ impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { }); Self { instruction } } + /// Metadata account + #[inline(always)] pub fn metadata( &mut self, metadata: &'a solana_program::account_info::AccountInfo<'a>, @@ -282,6 +299,8 @@ impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { self.instruction.metadata = Some(metadata); self } + /// Collection Update authority + #[inline(always)] pub fn collection_authority( &mut self, collection_authority: &'a solana_program::account_info::AccountInfo<'a>, @@ -289,10 +308,14 @@ impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection_authority = Some(collection_authority); self } + /// payer + #[inline(always)] pub fn payer(&mut self, payer: &'a solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); self } + /// Mint of the Collection + #[inline(always)] pub fn collection_mint( &mut self, collection_mint: &'a solana_program::account_info::AccountInfo<'a>, @@ -300,6 +323,8 @@ impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection_mint = Some(collection_mint); self } + /// Metadata Account of the Collection + #[inline(always)] pub fn collection( &mut self, collection: &'a solana_program::account_info::AccountInfo<'a>, @@ -307,6 +332,8 @@ impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { self.instruction.collection = Some(collection); self } + /// MasterEdition2 Account of the Collection Token + #[inline(always)] pub fn collection_master_edition_account( &mut self, collection_master_edition_account: &'a solana_program::account_info::AccountInfo<'a>, @@ -315,6 +342,9 @@ impl<'a> VerifySizedCollectionItemCpiBuilder<'a> { Some(collection_master_edition_account); self } + /// `[optional account]` + /// Collection Authority Record PDA + #[inline(always)] pub fn collection_authority_record( &mut self, collection_authority_record: &'a solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/lib.rs b/clients/rust/src/lib.rs index c34990c8..1682e557 100644 --- a/clients/rust/src/lib.rs +++ b/clients/rust/src/lib.rs @@ -1,8 +1,8 @@ mod generated; pub use generated::*; - pub mod hooked; +/// Removes all null bytes from a string. pub fn clean(value: String) -> String { value.replace('\0', "") } From b21059b2fd10c31813564edda0a6d9a1b92da33e Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 18 Aug 2023 22:01:17 +0300 Subject: [PATCH 05/31] Add tests --- clients/rust/tests/create.rs | 164 ++++++++++++++++++++++ clients/rust/tests/lock.rs | 97 +++++++++++++ clients/rust/tests/setup/digital_asset.rs | 128 +++++++++++++++++ clients/rust/tests/setup/dirty_clone.rs | 11 ++ clients/rust/tests/setup/mod.rs | 28 ++++ 5 files changed, 428 insertions(+) create mode 100644 clients/rust/tests/create.rs create mode 100644 clients/rust/tests/lock.rs create mode 100644 clients/rust/tests/setup/digital_asset.rs create mode 100644 clients/rust/tests/setup/dirty_clone.rs create mode 100644 clients/rust/tests/setup/mod.rs diff --git a/clients/rust/tests/create.rs b/clients/rust/tests/create.rs new file mode 100644 index 00000000..adb02faa --- /dev/null +++ b/clients/rust/tests/create.rs @@ -0,0 +1,164 @@ +#[cfg(feature = "test-sbf")] +pub mod setup; +use setup::*; + +use solana_program::borsh0_10::try_from_slice_unchecked; +use solana_program::pubkey::Pubkey; +use solana_program::system_program; +use solana_program_test::*; +use solana_sdk::{ + signature::{Keypair, Signer}, + transaction::Transaction, +}; + +use mpl_token_metadata_sdk::accounts::MasterEdition; +use mpl_token_metadata_sdk::{ + accounts::Metadata, + types::{Key, PrintSupply}, +}; +use mpl_token_metadata_sdk::{ + clean, + instructions::{CreateV1, CreateV1InstructionArgs}, +}; +use mpl_token_metadata_sdk::{instructions::CreateV1Builder, types::TokenStandard}; + +mod create { + + use super::*; + + #[tokio::test] + async fn create_nonfungible() { + let mut context = program_test().start_with_context().await; + + // given a mint address + + let payer_pubkey = context.payer.pubkey(); + let mint = Keypair::new(); + let mint_pubkey = mint.pubkey(); + + let (metadata, _) = Metadata::find_pda(&mint_pubkey); + let (master_edition, _) = MasterEdition::find_pda(&mint_pubkey); + + // when we create a non-fungible metadata + + let create_ix = CreateV1Builder::new() + .metadata(metadata) + .master_edition(master_edition) + .mint(mint_pubkey, true) + .authority(payer_pubkey) + .payer(payer_pubkey) + .update_authority(payer_pubkey, true) + .is_mutable(true) + .primary_sale_happened(false) + .name(String::from("NonFungible")) + .symbol(String::from("NFT")) + .uri(String::from("http://my.nft")) + .seller_fee_basis_points(500) + .token_standard(TokenStandard::NonFungible) + .print_supply(PrintSupply::Zero) + .build(); + + let tx = Transaction::new_signed_with_payer( + &[create_ix], + Some(&context.payer.pubkey()), + &[&context.payer, &mint], + context.last_blockhash, + ); + + context.banks_client.process_transaction(tx).await.unwrap(); + + // then the metadata is created with the correct values + + let metadata_account = get_account(&mut context, &metadata).await; + let metadata: Metadata = try_from_slice_unchecked(&metadata_account.data).unwrap(); + + assert!(!metadata.primary_sale_happened); + assert!(metadata.is_mutable); + + assert_eq!(metadata.key, Key::MetadataV1); + assert_eq!(clean(metadata.name), String::from("NonFungible")); + assert_eq!(clean(metadata.symbol), String::from("NFT")); + assert_eq!(clean(metadata.uri), String::from("http://my.nft")); + assert_eq!(metadata.seller_fee_basis_points, 500); + assert_eq!(metadata.creators, None); + assert_eq!(metadata.mint, mint_pubkey); + assert_eq!(metadata.update_authority, context.payer.pubkey()); + assert_eq!(metadata.token_standard, Some(TokenStandard::NonFungible)); + } + + #[tokio::test] + async fn create_programmable_nonfungible() { + let mut context = program_test().start_with_context().await; + + // given a mint address + + let payer_pubkey = context.payer.pubkey(); + let mint = Keypair::new(); + let mint_pubkey = mint.pubkey(); + + let metadata_seeds = &[b"metadata", PROGRAM_ID.as_ref(), mint_pubkey.as_ref()]; + let (metadata, _) = Pubkey::find_program_address(metadata_seeds, &PROGRAM_ID); + + let master_edition_seeds = &[ + b"metadata", + PROGRAM_ID.as_ref(), + mint_pubkey.as_ref(), + b"edition", + ]; + let (master_edition, _) = Pubkey::find_program_address(master_edition_seeds, &PROGRAM_ID); + + // when we create a programmable non-fungible metadata + + let mut args = CreateV1InstructionArgs::new( + String::from("pNFT"), + String::from("http://my.pnft"), + 500, + None, + TokenStandard::ProgrammableNonFungible, + ); + args.print_supply = Some(PrintSupply::Zero); + + let create_ix = CreateV1 { + metadata, + master_edition: Some(master_edition), + mint: (mint_pubkey, true), + authority: payer_pubkey, + update_authority: (payer_pubkey, true), + payer: payer_pubkey, + spl_token_program: spl_token::ID, + system_program: system_program::ID, + sysvar_instructions: solana_program::sysvar::instructions::ID, + } + .instruction(args); + + let tx = Transaction::new_signed_with_payer( + &[create_ix], + Some(&context.payer.pubkey()), + &[&context.payer, &mint], + context.last_blockhash, + ); + + context.banks_client.process_transaction(tx).await.unwrap(); + + // then the metadata is created with the correct values + + let metadata_account = get_account(&mut context, &metadata).await; + let metadata: Metadata = try_from_slice_unchecked(&metadata_account.data).unwrap(); + + assert!(!metadata.primary_sale_happened); + assert!(metadata.is_mutable); + + assert_eq!(metadata.key, Key::MetadataV1); + assert_eq!(clean(metadata.name), String::from("pNFT")); + assert_eq!(clean(metadata.symbol), String::from("")); + assert_eq!(clean(metadata.uri), String::from("http://my.pnft")); + assert_eq!(metadata.seller_fee_basis_points, 500); + assert_eq!(metadata.creators, None); + assert_eq!(metadata.mint, mint_pubkey); + assert_eq!(metadata.update_authority, context.payer.pubkey()); + assert_eq!( + metadata.token_standard, + Some(TokenStandard::ProgrammableNonFungible) + ); + } +} diff --git a/clients/rust/tests/lock.rs b/clients/rust/tests/lock.rs new file mode 100644 index 00000000..0b212975 --- /dev/null +++ b/clients/rust/tests/lock.rs @@ -0,0 +1,97 @@ +#[cfg(feature = "test-sbf")] +pub mod setup; +use setup::*; + +use solana_program::program_pack::Pack; +use solana_program_test::*; +use solana_sdk::signature::{Keypair, Signer}; +use solana_sdk::transaction::Transaction; +use spl_token::state::Account; + +use mpl_token_metadata_sdk::instructions::DelegateStandardV1Builder; +use mpl_token_metadata_sdk::instructions::LockV1Builder; +use mpl_token_metadata_sdk::types::TokenStandard; + +mod lock { + + use super::*; + + #[tokio::test] + async fn delegate_lock_nonfungible() { + let mut context = program_test().start_with_context().await; + + // given a non-fungible asset and a token + + let update_authority = Keypair::new(); + let token_owner = Keypair::new(); + let payer = context.payer.dirty_clone(); + + let mut asset = DigitalAsset::default(); + asset + .create_and_mint( + &mut context, + TokenStandard::NonFungible, + &update_authority, + &token_owner.pubkey(), + 1, + &payer, + ) + .await + .unwrap(); + + // and a standard delegate + + let delegate = Keypair::new(); + + let delegate_ix = DelegateStandardV1Builder::new() + .token(asset.token) + .metadata(asset.metadata) + .master_edition(asset.master_edition) + .mint(asset.mint.pubkey()) + .delegate(delegate.pubkey()) + .authority(token_owner.pubkey()) + .spl_token_program(spl_token::ID) + .payer(payer.pubkey()) + .amount(1) + .build(); + + let tx = Transaction::new_signed_with_payer( + &[delegate_ix], + Some(&context.payer.pubkey()), + &[&payer, &token_owner], + context.last_blockhash, + ); + context.banks_client.process_transaction(tx).await.unwrap(); + + // when we lock the token + + let lock_ix = LockV1Builder::new() + .authority(delegate.pubkey()) + .metadata(asset.metadata) + .edition(asset.master_edition) + .mint(asset.mint.pubkey()) + .token(asset.token) + .spl_token_program(spl_token::ID) + .payer(payer.pubkey()) + .build(); + + let tx = Transaction::new_signed_with_payer( + &[lock_ix], + Some(&context.payer.pubkey()), + &[&payer, &delegate], + context.last_blockhash, + ); + context.banks_client.process_transaction(tx).await.unwrap(); + + // then the token is frozen + + let token_account = get_account(&mut context, &asset.token).await; + let token = Account::unpack(&token_account.data).unwrap(); + assert!(token.is_frozen()); + + // and the delegate is set + + assert!(token.delegate.is_some()); + assert_eq!(token.delegate.unwrap(), delegate.pubkey()); + } +} diff --git a/clients/rust/tests/setup/digital_asset.rs b/clients/rust/tests/setup/digital_asset.rs new file mode 100644 index 00000000..b2c63cb8 --- /dev/null +++ b/clients/rust/tests/setup/digital_asset.rs @@ -0,0 +1,128 @@ +use mpl_token_metadata_sdk::{ + accounts::{MasterEdition, Metadata}, + instructions::{CreateV1Builder, MintV1Builder}, + types::{PrintSupply, TokenStandard}, +}; +use solana_program::pubkey::Pubkey; +use solana_program_test::{BanksClientError, ProgramTestContext}; +use solana_sdk::{ + signature::{Keypair, Signer}, + transaction::Transaction, +}; + +pub struct DigitalAsset { + pub mint: Keypair, + pub metadata: Pubkey, + pub master_edition: Pubkey, + pub token: Pubkey, +} + +impl Default for DigitalAsset { + fn default() -> Self { + Self { + mint: Keypair::new(), + metadata: Pubkey::default(), + master_edition: Pubkey::default(), + token: Pubkey::default(), + } + } +} + +impl DigitalAsset { + pub async fn create( + &mut self, + context: &mut ProgramTestContext, + name: String, + uri: String, + token_standard: TokenStandard, + update_authority: &Keypair, + payer: &Keypair, + ) -> Result<(), BanksClientError> { + self.metadata = Metadata::find_pda(&self.mint.pubkey()).0; + self.master_edition = MasterEdition::find_pda(&self.mint.pubkey()).0; + + let create_ix = CreateV1Builder::new() + .metadata(self.metadata) + .master_edition(self.master_edition) + .mint(self.mint.pubkey(), true) + .authority(update_authority.pubkey()) + .payer(payer.pubkey()) + .update_authority(update_authority.pubkey(), true) + .is_mutable(true) + .primary_sale_happened(false) + .seller_fee_basis_points(500) + .print_supply(PrintSupply::Zero) + .name(name) + .uri(uri) + .token_standard(token_standard) + .build(); + + let tx = Transaction::new_signed_with_payer( + &[create_ix], + Some(&context.payer.pubkey()), + &[payer, update_authority, &self.mint], + context.last_blockhash, + ); + context.banks_client.process_transaction(tx).await + } + + pub async fn mint( + &mut self, + context: &mut ProgramTestContext, + token_owner: &Pubkey, + amount: u64, + update_authority: &Keypair, + payer: &Keypair, + ) -> Result<(), BanksClientError> { + self.token = spl_associated_token_account::get_associated_token_address_with_program_id( + token_owner, + &self.mint.pubkey(), + &spl_token::ID, + ); + + let mint_ix = MintV1Builder::new() + .token(self.token) + .token_owner(*token_owner) + .metadata(self.metadata) + .master_edition(self.master_edition) + .mint(self.mint.pubkey()) + .authority(update_authority.pubkey()) + .payer(payer.pubkey()) + .amount(amount) + .build(); + + let tx = Transaction::new_signed_with_payer( + &[mint_ix], + Some(&context.payer.pubkey()), + &[payer, update_authority], + context.last_blockhash, + ); + context.banks_client.process_transaction(tx).await + } + + #[allow(clippy::too_many_arguments)] + pub async fn create_and_mint( + &mut self, + context: &mut ProgramTestContext, + token_standard: TokenStandard, + update_authority: &Keypair, + token_owner: &Pubkey, + amount: u64, + payer: &Keypair, + ) -> Result<(), BanksClientError> { + self.create( + context, + String::from("Digial Asset"), + String::from("https://digital.asset"), + token_standard, + update_authority, + payer, + ) + .await?; + + self.mint(context, token_owner, amount, update_authority, payer) + .await?; + + Ok(()) + } +} diff --git a/clients/rust/tests/setup/dirty_clone.rs b/clients/rust/tests/setup/dirty_clone.rs new file mode 100644 index 00000000..798107d6 --- /dev/null +++ b/clients/rust/tests/setup/dirty_clone.rs @@ -0,0 +1,11 @@ +use solana_sdk::signature::Keypair; + +pub trait DirtyClone { + fn dirty_clone(&self) -> Self; +} + +impl DirtyClone for Keypair { + fn dirty_clone(&self) -> Self { + Keypair::from_bytes(&self.to_bytes()).unwrap() + } +} diff --git a/clients/rust/tests/setup/mod.rs b/clients/rust/tests/setup/mod.rs new file mode 100644 index 00000000..8accb21d --- /dev/null +++ b/clients/rust/tests/setup/mod.rs @@ -0,0 +1,28 @@ +mod digital_asset; +mod dirty_clone; + +pub use digital_asset::*; +pub use dirty_clone::*; + +use solana_program::pubkey::Pubkey; +use solana_program_test::{ProgramTest, ProgramTestContext}; +use solana_sdk::account::Account; + +pub const PROGRAM_ID: Pubkey = mpl_token_metadata_sdk::MPL_TOKEN_METADATA_ID; + +pub fn program_test() -> ProgramTest { + ProgramTest::new( + "mpl_token_metadata", + mpl_token_metadata_sdk::MPL_TOKEN_METADATA_ID, + None, + ) +} + +pub async fn get_account(context: &mut ProgramTestContext, pubkey: &Pubkey) -> Account { + context + .banks_client + .get_account(*pubkey) + .await + .unwrap() + .expect("account not found") +} From b2bc67c5a96550faace4b6575055fd264b56adfe Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 18 Aug 2023 22:01:38 +0300 Subject: [PATCH 06/31] Add readme --- clients/rust/README.md | 216 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 clients/rust/README.md diff --git a/clients/rust/README.md b/clients/rust/README.md new file mode 100644 index 00000000..3b5f01e0 --- /dev/null +++ b/clients/rust/README.md @@ -0,0 +1,216 @@ + # Metaplex Token Metadata Client SDK + + Rust client library for the Token Metadata program. + + ## Structure + + The client SDK is divided into several modules: + + * `accounts`: structs representing the accounts of the program + * `errors`: enums representing the program errors + * `instructions`: structs to facilitate the creation of instructions, instruction arguments and CPI instructions + * `types`: structs representing types used by the program + +## Instruction Builders + +One of the main features of the client SDK is to facilitate the creation of instructions. There are two "types" of instruction builders automatically generated – both support passing accounts by name and optional positional accounts. + +### _Client_ instruction builders + +This are intended to be used by off-chain client code. Each instruction is represented by a corresponding struct – e.g., `CreateV1`: +```rust +pub struct CreateV1 { + /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] + pub metadata: solana_program::pubkey::Pubkey, + /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] + pub master_edition: Option, + /// Mint of token asset + pub mint: (solana_program::pubkey::Pubkey, bool), + /// Mint authority + pub authority: solana_program::pubkey::Pubkey, + /// Payer + pub payer: solana_program::pubkey::Pubkey, + /// Update authority for the metadata account + pub update_authority: (solana_program::pubkey::Pubkey, bool), + /// System program + pub system_program: solana_program::pubkey::Pubkey, + /// Instructions sysvar account + pub sysvar_instructions: solana_program::pubkey::Pubkey, + /// SPL Token program + pub spl_token_program: solana_program::pubkey::Pubkey, +} +``` + +After filling in the instruction account fields, you can use the `instruction(...)` method to generate the corresponding `solana_program::instruction::Instruction`: +```rust +// instruction args +let mut args = CreateV1InstructionArgs::new( + String::from("pNFT"), + String::from("http://my.pnft"), + 500, + None, + TokenStandard::ProgrammableNonFungible, +); +args.print_supply = Some(PrintSupply::Zero); + +// instruction accounts +let create_accounts = CreateV1 { + metadata, + master_edition: Some(master_edition), + ... +}; + +// creates the instruction +let create_ix = create_accounts.instruction(args); +``` + +Alternatively, you can use the `CreateV1Builder` to create the appropriate instruction: +```rust +let create_ix = CreateV1Builder::new() + .metadata(metadata) + .master_edition(master_edition) + .mint(mint_pubkey, true) + .authority(payer_pubkey) + .payer(payer_pubkey) + .update_authority(payer_pubkey, true) + .is_mutable(true) + .primary_sale_happened(false) + .name(String::from("pNFT")) + .uri(String::from("http://my.pnft")) + .seller_fee_basis_points(500) + .token_standard(TokenStandard::ProgrammableNonFungible) + .print_supply(PrintSupply::Zero) + .build(); +``` + +### _CPI_ instruction builders + +These are builders to be used by on-chain code, which will CPI into Token Metadata. Following the same example as above, we have a `CreateV1Cpi` struct: +```rust +pub struct CreateV1Cpi<'a> { + /// The program to invoke. + pub __program: &'a solana_program::account_info::AccountInfo<'a>, + /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] + pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Mint of token asset + pub mint: (&'a solana_program::account_info::AccountInfo<'a>, bool), + /// Mint authority + pub authority: &'a solana_program::account_info::AccountInfo<'a>, + /// Payer + pub payer: &'a solana_program::account_info::AccountInfo<'a>, + /// Update authority for the metadata account + pub update_authority: (&'a solana_program::account_info::AccountInfo<'a>, bool), + /// System program + pub system_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Instructions sysvar account + pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Token program + pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// The arguments for the instruction. + pub __args: CreateV1InstructionArgs, +} +``` + +After filling in the instruction account info and argument fields, you can use the `invoke()` or `invoke_signed(...)` method to perform the CPI: +```rust +// instruction args +let mut args = CreateV1InstructionArgs::new( + String::from("pNFT"), + String::from("http://my.pnft"), + 500, + None, + TokenStandard::ProgrammableNonFungible, +); +args.print_supply = Some(PrintSupply::Zero); + +// instruction accounts +let cpi_create = CreateV1Cpi { + __program: ctx.accounts.token_metadata_program, + metadata: ctx.accounts.metadata, + master_edition: Some(ctx.accounts.master_edition), + ... + __args: args, +}; + +// performs the CPI +cpi_create.invoke()?; +``` + +You can also use the `CreateV1CpiBuilder` to simplify the process: +```rust +let cpi_create = CreateV1CpiBuilder::new(ctx.accounts.token_metadata_program) + .metadata(ctx.accounts.metadata) + .master_edition(ctx.accounts.master_edition) + .mint(ctx.accounts.mint_pubkey, true) + .authority(ctx.accounts.payer_pubkey) + .payer(ctx.accounts.payer_pubkey) + .update_authority(ctx.accounts.payer_pubkey, true) + .system_program(ctx.accounts.system_program) + .sysvar_instructions(ctx.accounts.sysvar_instructions) + .spl_token_program(ctx.accounts.spl_token_program) + .is_mutable(true) + .primary_sale_happened(false) + .name(String::from("pNFT")) + .uri(String::from("http://my.pnft")) + .seller_fee_basis_points(500) + .token_standard(TokenStandard::ProgrammableNonFungible) + .print_supply(PrintSupply::Zero) + .build(); +cpi_create.invoke()?; +``` + +## PDA helpers + +Account types (e.g., `Metadata`) have associated functions to find PDA or to create PDA `Pubkey`s: +```rust +impl Metadata { + pub fn find_pda(mint: Pubkey) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} +``` +> If a bump seed is known, it is _cheaper_ (less compute units) to use the `create_pda` function, in particular for on-chain code. + + ## Why using a client library? + + Using a program crate as a dependency has its caveats. The main one is that you are bound to the same dependencies of that program, which tend to be quite a few. In many cases, this leads to dependency problems when trying to update crate versions. Secondly, the program crate is generated from the program source code, which its main purpose is to offer the functionality of the program, not necessarily a _friendly_ client API. + + Enter a client crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. + + ## Testing + + To run the SDK tests, run the following from the root directory of the repository: + ```bash + pnpm install + ``` + and then: + ```bash + pnpm programs:sdk + ``` + + ## Documentation + + The crate documentation can be found [here](https://docs.rs/mpl-token-metadata/latest/mpl_token_metadata/). From 4c0573c6e49317b4642c4606ca278a4c5d1f1b64 Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 18 Aug 2023 22:01:52 +0300 Subject: [PATCH 07/31] Tweak dependency versions --- clients/rust/Cargo.lock | 2 ++ clients/rust/Cargo.toml | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/clients/rust/Cargo.lock b/clients/rust/Cargo.lock index 4265f556..1e3c5d48 100644 --- a/clients/rust/Cargo.lock +++ b/clients/rust/Cargo.lock @@ -2066,6 +2066,8 @@ version = "0.0.1" dependencies = [ "assert_matches", "borsh 0.10.3", + "num-derive", + "num-traits", "solana-program", "solana-program-test", "solana-sdk", diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index d5b943f6..a3ac60da 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "mpl-token-metadata-sdk" version = "0.0.1" -description = "Metaplex Token Metadata" +description = "Metaplex Token Metadata Client SDK" authors = ["Metaplex Developers "] repository = "https://github.com/metaplex-foundation/mpl-token-metadata" license-file = "../../LICENSE" edition = "2021" -readme = "../../programs/token-metadata/program/README.md" +readme = "README.md" [lib] crate-type = ["cdylib", "lib"] @@ -16,7 +16,9 @@ test-sbf = [] [dependencies] solana-program = "^1.10" -borsh = ">= 0.9" +borsh = ">= 0.9, < 0.11" +num-derive = "^0.3" +num-traits = "^0.2" thiserror = "^1.0" [dev-dependencies] From 3e2566cf245fffa0d30e48032575d36b4e4651b7 Mon Sep 17 00:00:00 2001 From: febo Date: Sat, 19 Aug 2023 00:44:59 +0300 Subject: [PATCH 08/31] Add rust sdk workflows --- .github/file-filters.yml | 7 ++++ .github/workflows/build-sdk.yml | 57 +++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 15 +++++++++ .github/workflows/test-sdk.yml | 37 +++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 .github/workflows/build-sdk.yml create mode 100644 .github/workflows/test-sdk.yml diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 83da2c5c..7fb245b7 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -24,6 +24,8 @@ programs: &programs client_common: &client_common - *programs - ".github/workflows/test-js.yml" + - ".github/workflows/test-sdk.yml" + - ".github/workflows/build-sdk.yml" - ".github/workflows/main.yml" - ".github/file-filters.yml" - ".github/.env" @@ -34,8 +36,13 @@ js_client: &js_client - *client_common - "clients/js/**" +rust_client: &rust_client + - *client_common + - "clients/rust/**" + clients: &clients - *js_client + - *rust_client # Any. diff --git a/.github/workflows/build-sdk.yml b/.github/workflows/build-sdk.yml new file mode 100644 index 00000000..77dbc102 --- /dev/null +++ b/.github/workflows/build-sdk.yml @@ -0,0 +1,57 @@ +name: Build Programs + +on: + workflow_call: + inputs: + rust: + type: string + solana: + type: string + workflow_dispatch: + inputs: + rust: + description: Rust version + default: 1.68.0 + required: true + type: string + solana: + description: Solana version + default: 1.16.8 + required: true + type: string + +env: + CACHE: true + +jobs: + build_sdk: + name: Build + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: Load environment variables + run: cat .github/.env >> $GITHUB_ENV + + - name: Install Rust + uses: metaplex-foundation/actions/install-rust@v1 + with: + toolchain: ${{ inputs.rust || env.RUST_VERSION }} + + - name: Install Solana + uses: metaplex-foundation/actions/install-solana@v1 + with: + version: ${{ inputs.solana || env.SOLANA_VERSION }} + cache: ${{ env.CACHE }} + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets --all-features --no-deps --manifest-path ./clients/rust/Cargo.toml + + - name: Build SDK + shell: bash + working-directory: clients/rust + run: cargo build diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 488fa027..8da796e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,7 @@ jobs: runs-on: ubuntu-latest outputs: js_changed: ${{ steps.changes.outputs.js_client }} + rust_changed: ${{ steps.changes.outputs.rust_client }} permissions: contents: write steps: @@ -104,3 +105,17 @@ jobs: needs: generate_clients uses: ./.github/workflows/test-js.yml secrets: inherit + + build_sdk: + if: needs.generate_clients.outputs.rust_changed == 'true' + name: Rust Client + needs: generate_clients + uses: ./.github/workflows/build-sdk.yml + secrets: inherit + + test_sdk: + if: needs.generate_clients.outputs.rust_changed == 'true' + name: Rust Client + needs: build_sdk + uses: ./.github/workflows/test-sdk.yml + secrets: inherit diff --git a/.github/workflows/test-sdk.yml b/.github/workflows/test-sdk.yml new file mode 100644 index 00000000..664a6b98 --- /dev/null +++ b/.github/workflows/test-sdk.yml @@ -0,0 +1,37 @@ +name: Test Programs + +on: + workflow_call: + inputs: + program_matrix: + type: string + +env: + CACHE: true + +jobs: + test_sdk: + name: Test + runs-on: ubuntu-latest-16-cores + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: Load environment variables + run: cat .github/.env >> $GITHUB_ENV + + - name: Install Rust + uses: metaplex-foundation/actions/install-rust@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + + - name: Install Solana + uses: metaplex-foundation/actions/install-solana@v1 + with: + version: ${{ env.SOLANA_VERSION }} + cache: ${{ env.CACHE }} + + - name: Run tests + shell: bash + working-directory: configs/program-scripts + run: RUST_LOG=error ./sdk.sh From e1b262330186fe0a2890179a95280e0985eeb2c2 Mon Sep 17 00:00:00 2001 From: febo Date: Sat, 19 Aug 2023 01:06:53 +0300 Subject: [PATCH 09/31] Use program builds --- .github/workflows/test-sdk.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-sdk.yml b/.github/workflows/test-sdk.yml index 664a6b98..7462f399 100644 --- a/.github/workflows/test-sdk.yml +++ b/.github/workflows/test-sdk.yml @@ -31,6 +31,11 @@ jobs: version: ${{ env.SOLANA_VERSION }} cache: ${{ env.CACHE }} + - name: Download program builds + uses: actions/download-artifact@v3 + with: + name: program-builds + - name: Run tests shell: bash working-directory: configs/program-scripts From 5a1c6018a94bd66c94a270cdf9f13fbf42c43ce7 Mon Sep 17 00:00:00 2001 From: febo Date: Sat, 19 Aug 2023 01:24:52 +0300 Subject: [PATCH 10/31] Run sdk workflows in parallel --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8da796e9..3f8b27d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -116,6 +116,6 @@ jobs: test_sdk: if: needs.generate_clients.outputs.rust_changed == 'true' name: Rust Client - needs: build_sdk + needs: generate_clients uses: ./.github/workflows/test-sdk.yml secrets: inherit From cc5f79da93881855a73480c69081b9feb4d218a8 Mon Sep 17 00:00:00 2001 From: febo Date: Sun, 20 Aug 2023 15:41:46 +0300 Subject: [PATCH 11/31] Rename program crate --- configs/kinobi.cjs | 2 +- configs/shank.cjs | 2 +- ...oken_metadata.json => token_metadata.json} | 2 +- programs/token-metadata/Cargo.lock | 52 +++++++-------- programs/token-metadata/program/Cargo.toml | 2 +- .../program/tests/approve_use_authority.rs | 40 +++++------ .../program/tests/bump_seed_migration.rs | 20 +++--- programs/token-metadata/program/tests/burn.rs | 24 +++---- .../program/tests/burn_edition_nft.rs | 8 +-- .../token-metadata/program/tests/burn_nft.rs | 8 +-- .../program/tests/collection_migrations.rs | 8 +-- .../program/tests/collection_sizes.rs | 8 +-- .../token-metadata/program/tests/create.rs | 12 ++-- .../program/tests/create_master_edition.rs | 2 +- .../program/tests/create_metadata_account.rs | 20 +++--- .../token-metadata/program/tests/delegate.rs | 12 ++-- .../token-metadata/program/tests/escrow.rs | 32 ++++----- programs/token-metadata/program/tests/fees.rs | 16 ++--- .../program/tests/freeze_authority.rs | 2 +- .../program/tests/freeze_delegated_account.rs | 22 +++---- programs/token-metadata/program/tests/lock.rs | 12 ++-- programs/token-metadata/program/tests/mint.rs | 2 +- ...w_edition_from_master_edition_via_token.rs | 14 ++-- .../token-metadata/program/tests/print.rs | 18 +++-- .../tests/process_legacy_instruction.rs | 16 ++--- .../token-metadata/program/tests/revoke.rs | 14 ++-- .../program/tests/revoke_use_authority.rs | 18 ++--- .../program/tests/seralization.rs | 4 +- .../program/tests/set_collection_size.rs | 22 +++---- .../program/tests/set_token_standard.rs | 12 ++-- .../program/tests/sign_metadata.rs | 8 +-- .../token-metadata/program/tests/transfer.rs | 60 ++++++++--------- .../token-metadata/program/tests/unlock.rs | 8 +-- .../token-metadata/program/tests/unverify.rs | 12 ++-- .../token-metadata/program/tests/update.rs | 54 +++++++-------- .../tests/update_metadata_account_v2.rs | 26 ++++---- .../update_primary_sale_happened_via_token.rs | 16 ++--- programs/token-metadata/program/tests/uses.rs | 58 ++++++++-------- .../program/tests/utils/collection.rs | 4 +- .../program/tests/utils/digital_asset.rs | 30 ++++----- .../program/tests/utils/edition_marker.rs | 43 ++++++------ .../program/tests/utils/master_edition_v2.rs | 16 ++--- .../program/tests/utils/metadata.rs | 12 ++-- .../token-metadata/program/tests/utils/mod.rs | 10 +-- .../program/tests/utils/programmable.rs | 8 +-- .../token-metadata/program/tests/verify.rs | 16 ++--- .../program/tests/verify_collection.rs | 66 +++++++++---------- .../tests/verify_sized_collection_item.rs | 50 +++++++------- 48 files changed, 458 insertions(+), 465 deletions(-) rename idls/{mpl_token_metadata.json => token_metadata.json} (99%) diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index 16650cc3..d4f5bed9 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -6,7 +6,7 @@ const clientDir = path.join(__dirname, "..", "clients"); const idlDir = path.join(__dirname, "..", "idls"); // Instanciate Kinobi. -const kinobi = k.createFromIdls([path.join(idlDir, "mpl_token_metadata.json")]); +const kinobi = k.createFromIdls([path.join(idlDir, "token_metadata.json")]); // Update Accounts. const metadataSeeds = [ diff --git a/configs/shank.cjs b/configs/shank.cjs index 5878561a..2b750a2c 100644 --- a/configs/shank.cjs +++ b/configs/shank.cjs @@ -7,7 +7,7 @@ const programDir = path.join(__dirname, "..", "programs"); generateIdl({ generator: "shank", - programName: "mpl_token_metadata", + programName: "token_metadata", programId: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", idlDir, binaryInstallDir, diff --git a/idls/mpl_token_metadata.json b/idls/token_metadata.json similarity index 99% rename from idls/mpl_token_metadata.json rename to idls/token_metadata.json index a6ea68c3..b49427b6 100644 --- a/idls/mpl_token_metadata.json +++ b/idls/token_metadata.json @@ -1,6 +1,6 @@ { "version": "1.13.2", - "name": "mpl_token_metadata", + "name": "token_metadata", "instructions": [ { "name": "CreateMetadataAccount", diff --git a/programs/token-metadata/Cargo.lock b/programs/token-metadata/Cargo.lock index 10673c03..dd73a427 100644 --- a/programs/token-metadata/Cargo.lock +++ b/programs/token-metadata/Cargo.lock @@ -2134,31 +2134,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "mpl-token-metadata" -version = "1.13.2" -dependencies = [ - "arrayref", - "async-trait", - "borsh 0.9.3", - "mpl-token-auth-rules", - "mpl-token-metadata-context-derive 0.3.0", - "mpl-utils 0.3.1", - "num-derive", - "num-traits", - "rmp-serde", - "rooster", - "serde", - "serde_with 1.14.0", - "shank 0.0.11", - "solana-program", - "solana-program-test", - "solana-sdk", - "spl-associated-token-account 1.1.3", - "spl-token 3.5.0", - "thiserror", -] - [[package]] name = "mpl-token-metadata-context-derive" version = "0.2.1" @@ -3033,7 +3008,7 @@ version = "0.1.0" source = "git+https://github.com/metaplex-foundation/rooster#e424745fd5abfe1442fd37f3814d1f908302499d" dependencies = [ "borsh 0.9.3", - "mpl-token-metadata 1.13.2-beta.1", + "mpl-token-metadata", "mpl-utils 0.3.1", "num-derive", "num-traits", @@ -5044,6 +5019,31 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "token_metadata" +version = "1.13.2" +dependencies = [ + "arrayref", + "async-trait", + "borsh 0.9.3", + "mpl-token-auth-rules", + "mpl-token-metadata-context-derive 0.3.0", + "mpl-utils 0.3.1", + "num-derive", + "num-traits", + "rmp-serde", + "rooster", + "serde", + "serde_with 1.14.0", + "shank 0.0.11", + "solana-program", + "solana-program-test", + "solana-sdk", + "spl-associated-token-account 1.1.3", + "spl-token 3.5.0", + "thiserror", +] + [[package]] name = "tokio" version = "1.14.1" diff --git a/programs/token-metadata/program/Cargo.toml b/programs/token-metadata/program/Cargo.toml index ee0ae2f8..3a0f9070 100644 --- a/programs/token-metadata/program/Cargo.toml +++ b/programs/token-metadata/program/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mpl-token-metadata" +name = "token_metadata" version = "1.13.2" description = "Metaplex Metadata" authors = ["Metaplex Developers "] diff --git a/programs/token-metadata/program/tests/approve_use_authority.rs b/programs/token-metadata/program/tests/approve_use_authority.rs index b19c7b14..7c1a8a0a 100644 --- a/programs/token-metadata/program/tests/approve_use_authority.rs +++ b/programs/token-metadata/program/tests/approve_use_authority.rs @@ -1,11 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ - error::MetadataError, - pda::find_use_authority_account, - state::{UseAuthorityRecord, UseMethod, Uses}, -}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -13,13 +8,18 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + error::MetadataError, + pda::find_use_authority_account, + state::{UseAuthorityRecord, UseMethod, Uses}, +}; use utils::*; mod approve_use_authority { use borsh::BorshDeserialize; - use mpl_token_metadata::{pda::find_program_as_burner_account, state::Key}; use solana_program::program_pack::Pack; use spl_token::state::Account; + use token_metadata::{pda::find_program_as_burner_account, state::Key}; use super::*; #[tokio::test] @@ -52,8 +52,8 @@ mod approve_use_authority { find_use_authority_account(&test_meta.mint.pubkey(), &use_authority.pubkey()); let (burner, _) = find_program_as_burner_account(); - let ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -112,8 +112,8 @@ mod approve_use_authority { find_use_authority_account(&test_meta.mint.pubkey(), &use_authority.pubkey()); let (burner, _) = find_program_as_burner_account(); - let ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -176,8 +176,8 @@ mod approve_use_authority { println!("{:?}", Account::unpack_from_slice(&thing.data).unwrap()); - let ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -245,8 +245,8 @@ mod approve_use_authority { println!("{:?}", Account::unpack_from_slice(&thing.data).unwrap()); - let ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -266,8 +266,8 @@ mod approve_use_authority { ); context.banks_client.process_transaction(tx).await.unwrap(); - let ix2 = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix2 = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -335,8 +335,8 @@ mod approve_use_authority { println!("{:?}", Account::unpack_from_slice(&thing.data).unwrap()); - let ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -395,8 +395,8 @@ mod approve_use_authority { let (burner, _) = find_program_as_burner_account(); - let ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), wrong_owner.pubkey(), diff --git a/programs/token-metadata/program/tests/bump_seed_migration.rs b/programs/token-metadata/program/tests/bump_seed_migration.rs index d7f92eb6..730260e1 100644 --- a/programs/token-metadata/program/tests/bump_seed_migration.rs +++ b/programs/token-metadata/program/tests/bump_seed_migration.rs @@ -2,7 +2,13 @@ pub mod utils; use borsh::{BorshDeserialize, BorshSerialize}; -use mpl_token_metadata::{ +use solana_program_test::*; +use solana_sdk::{ + account::{Account, AccountSharedData}, + signature::{Keypair, Signer}, + transaction::Transaction, +}; +use token_metadata::{ pda::{find_program_as_burner_account, find_use_authority_account}, state::{ Key as MetadataKey, UseAuthorityRecord, UseMethod, Uses, MAX_NAME_LENGTH, @@ -10,12 +16,6 @@ use mpl_token_metadata::{ }, utils::puffed_out_string, }; -use solana_program_test::*; -use solana_sdk::{ - account::{Account, AccountSharedData}, - signature::{Keypair, Signer}, - transaction::Transaction, -}; use utils::*; mod bump_seed_migration { @@ -64,7 +64,7 @@ mod bump_seed_migration { let mut account = Account { lamports: 1113600, data: vec![], - owner: mpl_token_metadata::ID, + owner: token_metadata::ID, executable: false, rent_epoch: 1, }; @@ -77,8 +77,8 @@ mod bump_seed_migration { .await .unwrap(); let (burner, _) = find_program_as_burner_account(); - let utilize_with_use_authority = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let utilize_with_use_authority = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), diff --git a/programs/token-metadata/program/tests/burn.rs b/programs/token-metadata/program/tests/burn.rs index c970cfb9..de0faec2 100644 --- a/programs/token-metadata/program/tests/burn.rs +++ b/programs/token-metadata/program/tests/burn.rs @@ -2,14 +2,6 @@ pub mod utils; -use mpl_token_metadata::{ - error::MetadataError, - instruction::{builders::BurnBuilder, BurnArgs, DelegateArgs, InstructionBuilder}, - state::{ - Collection, CollectionDetails, Creator, Key, MasterEditionV2 as ProgramMasterEditionV2, - Metadata as ProgramMetadata, PrintSupply, TokenMetadataAccount, TokenStandard, - }, -}; use num_traits::FromPrimitive; use solana_program::{program_pack::Pack, pubkey::Pubkey}; use solana_program_test::*; @@ -21,11 +13,19 @@ use solana_sdk::{ }; use spl_associated_token_account::get_associated_token_address; use spl_token::state::Account as TokenAccount; +use token_metadata::{ + error::MetadataError, + instruction::{builders::BurnBuilder, BurnArgs, DelegateArgs, InstructionBuilder}, + state::{ + Collection, CollectionDetails, Creator, Key, MasterEditionV2 as ProgramMasterEditionV2, + Metadata as ProgramMetadata, PrintSupply, TokenMetadataAccount, TokenStandard, + }, +}; use utils::*; mod pnft { - use mpl_token_metadata::{instruction::TransferArgs, pda::find_token_record_account}; use solana_program::system_instruction; + use token_metadata::{instruction::TransferArgs, pda::find_token_record_account}; use super::*; @@ -559,7 +559,7 @@ mod pnft { &fake_token_record.pubkey(), 100_000_000, 80, - &mpl_token_metadata::ID, + &token_metadata::ID, ); let args = BurnArgs::V1 { amount: 1 }; @@ -1000,7 +1000,7 @@ mod pnft { } mod pnft_edition { - use mpl_token_metadata::pda::find_token_record_account; + use token_metadata::pda::find_token_record_account; use super::*; @@ -3600,8 +3600,8 @@ mod nft_edition { } mod fungible { - use mpl_token_metadata::instruction::TransferArgs; use solana_program::native_token::LAMPORTS_PER_SOL; + use token_metadata::instruction::TransferArgs; use super::*; diff --git a/programs/token-metadata/program/tests/burn_edition_nft.rs b/programs/token-metadata/program/tests/burn_edition_nft.rs index 2986864e..9947b537 100644 --- a/programs/token-metadata/program/tests/burn_edition_nft.rs +++ b/programs/token-metadata/program/tests/burn_edition_nft.rs @@ -7,13 +7,13 @@ use solana_sdk::{instruction::InstructionError, signer::Signer, transaction::Tra use utils::*; mod burn_edition_nft { - use mpl_token_metadata::{ - error::MetadataError, - state::{MasterEditionV2 as ProgramMasterEdition, TokenMetadataAccount}, - }; use solana_program::pubkey::Pubkey; use solana_sdk::signature::Keypair; use spl_associated_token_account::get_associated_token_address; + use token_metadata::{ + error::MetadataError, + state::{MasterEditionV2 as ProgramMasterEdition, TokenMetadataAccount}, + }; use super::*; diff --git a/programs/token-metadata/program/tests/burn_nft.rs b/programs/token-metadata/program/tests/burn_nft.rs index e978bf29..26df549e 100644 --- a/programs/token-metadata/program/tests/burn_nft.rs +++ b/programs/token-metadata/program/tests/burn_nft.rs @@ -1,20 +1,20 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::state::Metadata as ProgramMetadata; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{instruction::InstructionError, signer::Signer, transaction::TransactionError}; +use token_metadata::state::Metadata as ProgramMetadata; use utils::*; mod burn_nft { use borsh::BorshDeserialize; - use mpl_token_metadata::{ + use solana_program::pubkey::Pubkey; + use solana_sdk::signature::Keypair; + use token_metadata::{ error::MetadataError, state::{Collection, CollectionDetails}, }; - use solana_program::pubkey::Pubkey; - use solana_sdk::signature::Keypair; use super::*; #[tokio::test] diff --git a/programs/token-metadata/program/tests/collection_migrations.rs b/programs/token-metadata/program/tests/collection_migrations.rs index aeef020d..d95c2046 100644 --- a/programs/token-metadata/program/tests/collection_migrations.rs +++ b/programs/token-metadata/program/tests/collection_migrations.rs @@ -16,12 +16,12 @@ use utils::*; // * Unsized -> Sized // * Unsized -> Unsized mod collection_migrations { - use mpl_token_metadata::{ + use solana_sdk::transaction::Transaction; + use token_metadata::{ error::MetadataError, pda::find_collection_authority_account, state::{Metadata as TmMetadata, TokenMetadataAccount}, }; - use solana_sdk::transaction::Transaction; use super::*; @@ -1185,8 +1185,8 @@ mod collection_migrations { &delegate_keypair.pubkey(), ); - let ix1 = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix1 = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, delegate_keypair.pubkey(), update_authority, diff --git a/programs/token-metadata/program/tests/collection_sizes.rs b/programs/token-metadata/program/tests/collection_sizes.rs index fa7b0e0c..990484e8 100644 --- a/programs/token-metadata/program/tests/collection_sizes.rs +++ b/programs/token-metadata/program/tests/collection_sizes.rs @@ -1,16 +1,16 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::state::Metadata as ProgramMetadata; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{instruction::InstructionError, transaction::TransactionError}; +use token_metadata::state::Metadata as ProgramMetadata; use utils::*; mod unsized_collection_handlers { - use mpl_token_metadata::{error::MetadataError, state::Collection}; use solana_sdk::{signature::Keypair, signer::Signer}; + use token_metadata::{error::MetadataError, state::Collection}; use super::*; @@ -247,8 +247,8 @@ mod unsized_collection_handlers { } mod sized_collection_handlers { - use mpl_token_metadata::{error::MetadataError, state::Collection}; use solana_sdk::{signature::Keypair, signer::Signer}; + use token_metadata::{error::MetadataError, state::Collection}; use super::*; #[tokio::test] @@ -449,8 +449,8 @@ mod sized_collection_handlers { mod size_tracking { use borsh::BorshDeserialize; - use mpl_token_metadata::state::{Collection, CollectionDetails}; use solana_sdk::{signature::Keypair, signer::Signer}; + use token_metadata::state::{Collection, CollectionDetails}; use super::*; #[tokio::test] diff --git a/programs/token-metadata/program/tests/create.rs b/programs/token-metadata/program/tests/create.rs index 589f4772..8f64499b 100644 --- a/programs/token-metadata/program/tests/create.rs +++ b/programs/token-metadata/program/tests/create.rs @@ -1,11 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ - state::{Key, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH}, - utils::puffed_out_string, - ID, -}; use num_traits::FromPrimitive; use solana_program::pubkey::Pubkey; use solana_program_test::*; @@ -14,6 +9,11 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + state::{Key, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH}, + utils::puffed_out_string, + ID, +}; use utils::*; mod create { @@ -21,7 +21,7 @@ mod create { use std::str::FromStr; use borsh::BorshDeserialize; - use mpl_token_metadata::{ + use token_metadata::{ error::MetadataError, instruction::{builders::CreateBuilder, CreateArgs, InstructionBuilder}, state::{ diff --git a/programs/token-metadata/program/tests/create_master_edition.rs b/programs/token-metadata/program/tests/create_master_edition.rs index 2da0a147..e8cfe598 100644 --- a/programs/token-metadata/program/tests/create_master_edition.rs +++ b/programs/token-metadata/program/tests/create_master_edition.rs @@ -1,7 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{error::MetadataError, instruction, state::Key, ID}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -9,6 +8,7 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::{error::MetadataError, instruction, state::Key, ID}; use utils::*; mod create_master_edition { diff --git a/programs/token-metadata/program/tests/create_metadata_account.rs b/programs/token-metadata/program/tests/create_metadata_account.rs index 44a02969..7ce65542 100644 --- a/programs/token-metadata/program/tests/create_metadata_account.rs +++ b/programs/token-metadata/program/tests/create_metadata_account.rs @@ -1,7 +1,15 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ +use num_traits::FromPrimitive; +use solana_program::{pubkey::Pubkey, system_instruction::assign}; +use solana_program_test::*; +use solana_sdk::{ + instruction::InstructionError, + signature::{Keypair, Signer}, + transaction::{Transaction, TransactionError}, +}; +use token_metadata::{ error::MetadataError, instruction, state::{ @@ -11,19 +19,11 @@ use mpl_token_metadata::{ utils::{puffed_out_string, BUBBLEGUM_PROGRAM_ADDRESS}, ID, }; -use num_traits::FromPrimitive; -use solana_program::{pubkey::Pubkey, system_instruction::assign}; -use solana_program_test::*; -use solana_sdk::{ - instruction::InstructionError, - signature::{Keypair, Signer}, - transaction::{Transaction, TransactionError}, -}; use utils::*; mod create_meta_accounts { - use mpl_token_metadata::state::TokenStandard; + use token_metadata::state::TokenStandard; use super::*; #[tokio::test] diff --git a/programs/token-metadata/program/tests/delegate.rs b/programs/token-metadata/program/tests/delegate.rs index 40025f59..0c15e61a 100644 --- a/programs/token-metadata/program/tests/delegate.rs +++ b/programs/token-metadata/program/tests/delegate.rs @@ -13,7 +13,10 @@ mod delegate { use borsh::BorshDeserialize; use mpl_token_auth_rules::error::RuleSetError; - use mpl_token_metadata::{ + use num_traits::FromPrimitive; + use solana_program::{program_option::COption, program_pack::Pack}; + use spl_token::state::Account; + use token_metadata::{ error::MetadataError, instruction::{DelegateArgs, MetadataDelegateRole}, pda::{find_metadata_delegate_record_account, find_token_record_account}, @@ -22,9 +25,6 @@ mod delegate { TokenStandard, }, }; - use num_traits::FromPrimitive; - use solana_program::{program_option::COption, program_pack::Pack}; - use spl_token::state::Account; use super::*; @@ -462,7 +462,7 @@ mod delegate { #[tokio::test] async fn store_rule_set_revision_on_delegate() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.set_compute_max_units(400_000); let mut context = program_test.start_with_context().await; @@ -608,7 +608,7 @@ mod delegate { #[tokio::test] async fn delegate_not_in_allow_list() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.set_compute_max_units(400_000); let mut context = program_test.start_with_context().await; diff --git a/programs/token-metadata/program/tests/escrow.rs b/programs/token-metadata/program/tests/escrow.rs index 735ae071..18706ca5 100644 --- a/programs/token-metadata/program/tests/escrow.rs +++ b/programs/token-metadata/program/tests/escrow.rs @@ -7,8 +7,8 @@ use utils::*; mod escrow { use borsh::BorshDeserialize; - use mpl_token_metadata::{escrow::find_escrow_account, state::EscrowAuthority}; use solana_program::program_pack::Pack; + use token_metadata::{escrow::find_escrow_account, state::EscrowAuthority}; use super::*; @@ -47,8 +47,8 @@ mod escrow { ); print!("\nEscrow Address: {:#?}\n", escrow_address); - let ix0 = mpl_token_metadata::escrow::create_escrow_account( - mpl_token_metadata::ID, + let ix0 = token_metadata::escrow::create_escrow_account( + token_metadata::ID, escrow_address.0, parent_test_metadata.pubkey, parent_test_metadata.mint.pubkey(), @@ -70,7 +70,7 @@ mod escrow { let _metadata = parent_test_metadata.get_data(&mut context).await; let escrow_account = get_account(&mut context, &escrow_address.0).await; - let escrow: mpl_token_metadata::state::TokenOwnedEscrow = + let escrow: token_metadata::state::TokenOwnedEscrow = BorshDeserialize::deserialize(&mut &escrow_account.data[..]).unwrap(); print!("\n{:#?}\n", escrow); @@ -139,7 +139,7 @@ mod escrow { let _metadata = attribute_test_metadata.get_data(&mut context).await; let escrow_account = get_account(&mut context, &escrow_address.0).await; - let escrow: mpl_token_metadata::state::TokenOwnedEscrow = + let escrow: token_metadata::state::TokenOwnedEscrow = BorshDeserialize::deserialize(&mut &escrow_account.data[..]).unwrap(); print!("\n{:#?}\n", escrow); @@ -166,8 +166,8 @@ mod escrow { &attribute_test_metadata.mint.pubkey(), ); - let ix2 = mpl_token_metadata::escrow::transfer_out_of_escrow( - mpl_token_metadata::ID, + let ix2 = token_metadata::escrow::transfer_out_of_escrow( + token_metadata::ID, escrow_address.0, parent_test_metadata.pubkey, context.payer.pubkey(), @@ -199,7 +199,7 @@ mod escrow { let _metadata = attribute_test_metadata.get_data(&mut context).await; let escrow_account = get_account(&mut context, &escrow_address.0).await; - let escrow: mpl_token_metadata::state::TokenOwnedEscrow = + let escrow: token_metadata::state::TokenOwnedEscrow = BorshDeserialize::deserialize(&mut &escrow_account.data[..]).unwrap(); print!("\n{:#?}\n", escrow); @@ -248,8 +248,8 @@ mod escrow { ); print!("\nEscrow Address: {:#?}\n", escrow_address); - let ix0 = mpl_token_metadata::escrow::create_escrow_account( - mpl_token_metadata::ID, + let ix0 = token_metadata::escrow::create_escrow_account( + token_metadata::ID, escrow_address.0, parent_test_metadata.pubkey, parent_test_metadata.mint.pubkey(), @@ -271,7 +271,7 @@ mod escrow { let _metadata = parent_test_metadata.get_data(&mut context).await; let escrow_account = get_account(&mut context, &escrow_address.0).await; - let escrow: mpl_token_metadata::state::TokenOwnedEscrow = + let escrow: token_metadata::state::TokenOwnedEscrow = BorshDeserialize::deserialize(&mut &escrow_account.data[..]).unwrap(); print!("\n{:#?}\n", escrow); @@ -332,7 +332,7 @@ mod escrow { let _metadata = attribute_test_metadata.get_data(&mut context).await; let escrow_account = get_account(&mut context, &escrow_address.0).await; - let escrow: mpl_token_metadata::state::TokenOwnedEscrow = + let escrow: token_metadata::state::TokenOwnedEscrow = BorshDeserialize::deserialize(&mut &escrow_account.data[..]).unwrap(); context.banks_client.process_transaction(tx1).await.unwrap(); @@ -361,8 +361,8 @@ mod escrow { &attribute_test_metadata.mint.pubkey(), ); - let ix2 = mpl_token_metadata::escrow::transfer_out_of_escrow( - mpl_token_metadata::ID, + let ix2 = token_metadata::escrow::transfer_out_of_escrow( + token_metadata::ID, escrow_address.0, parent_test_metadata.pubkey, context.payer.pubkey(), @@ -375,8 +375,8 @@ mod escrow { 1, ); - let ix3 = mpl_token_metadata::escrow::transfer_out_of_escrow( - mpl_token_metadata::ID, + let ix3 = token_metadata::escrow::transfer_out_of_escrow( + token_metadata::ID, escrow_address.0, parent_test_metadata.pubkey, context.payer.pubkey(), diff --git a/programs/token-metadata/program/tests/fees.rs b/programs/token-metadata/program/tests/fees.rs index 0f62c2b0..c227f24e 100644 --- a/programs/token-metadata/program/tests/fees.rs +++ b/programs/token-metadata/program/tests/fees.rs @@ -5,16 +5,16 @@ use solana_program_test::*; use utils::*; mod fees { - use mpl_token_metadata::{ - instruction::{collect_fees, BurnArgs, UpdateArgs}, - state::{CREATE_FEE, FEE_FLAG_CLEARED, METADATA_FEE_FLAG_INDEX}, - }; use solana_program::{native_token::LAMPORTS_PER_SOL, pubkey::Pubkey}; use solana_sdk::{ signature::{read_keypair_file, Keypair}, signer::Signer, transaction::Transaction, }; + use token_metadata::{ + instruction::{collect_fees, BurnArgs, UpdateArgs}, + state::{CREATE_FEE, FEE_FLAG_CLEARED, METADATA_FEE_FLAG_INDEX}, + }; use super::*; @@ -36,7 +36,7 @@ mod fees { let mut nft = DigitalAsset::new(); nft.create( &mut context, - mpl_token_metadata::state::TokenStandard::NonFungible, + token_metadata::state::TokenStandard::NonFungible, None, ) .await @@ -55,7 +55,7 @@ mod fees { let mut nft = DigitalAsset::new(); nft.create( &mut context, - mpl_token_metadata::state::TokenStandard::NonFungible, + token_metadata::state::TokenStandard::NonFungible, None, ) .await @@ -103,7 +103,7 @@ mod fees { let mut nft = DigitalAsset::new(); nft.create( &mut context, - mpl_token_metadata::state::TokenStandard::NonFungible, + token_metadata::state::TokenStandard::NonFungible, None, ) .await @@ -163,7 +163,7 @@ mod fees { let mut nft = DigitalAsset::new(); nft.create_and_mint( &mut context, - mpl_token_metadata::state::TokenStandard::NonFungible, + token_metadata::state::TokenStandard::NonFungible, None, None, 1, diff --git a/programs/token-metadata/program/tests/freeze_authority.rs b/programs/token-metadata/program/tests/freeze_authority.rs index d42da938..5c61b427 100644 --- a/programs/token-metadata/program/tests/freeze_authority.rs +++ b/programs/token-metadata/program/tests/freeze_authority.rs @@ -1,10 +1,10 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::error::MetadataError; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{instruction::InstructionError, transaction::TransactionError}; +use token_metadata::error::MetadataError; use utils::*; #[tokio::test] diff --git a/programs/token-metadata/program/tests/freeze_delegated_account.rs b/programs/token-metadata/program/tests/freeze_delegated_account.rs index 219917e8..b6c3ca76 100644 --- a/programs/token-metadata/program/tests/freeze_delegated_account.rs +++ b/programs/token-metadata/program/tests/freeze_delegated_account.rs @@ -1,7 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::error::MetadataError; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -9,6 +8,7 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::error::MetadataError; use utils::*; mod freeze_delegated { @@ -66,8 +66,8 @@ mod freeze_delegated { // delegate freezes token let freeze_tx = Transaction::new_signed_with_payer( - &[mpl_token_metadata::instruction::freeze_delegated_account( - mpl_token_metadata::ID, + &[token_metadata::instruction::freeze_delegated_account( + token_metadata::ID, delegate.pubkey(), test_metadata.token.pubkey(), test_master_edition.pubkey, @@ -143,8 +143,8 @@ mod freeze_delegated { .unwrap(); // delegate freezes token - let freeze_ix = mpl_token_metadata::instruction::freeze_delegated_account( - mpl_token_metadata::ID, + let freeze_ix = token_metadata::instruction::freeze_delegated_account( + token_metadata::ID, delegate.pubkey(), test_metadata.token.pubkey(), test_metadata.pubkey, @@ -197,8 +197,8 @@ mod freeze_delegated { .unwrap(); // attempt to freeze delegated account - let freeze_ix = mpl_token_metadata::instruction::freeze_delegated_account( - mpl_token_metadata::ID, + let freeze_ix = token_metadata::instruction::freeze_delegated_account( + token_metadata::ID, context.payer.pubkey(), test_metadata.token.pubkey(), test_master_edition.pubkey, @@ -263,8 +263,8 @@ mod freeze_delegated { .unwrap(); // delegate freezes token - let freeze_ix = mpl_token_metadata::instruction::freeze_delegated_account( - mpl_token_metadata::ID, + let freeze_ix = token_metadata::instruction::freeze_delegated_account( + token_metadata::ID, delegate.pubkey(), test_metadata.token.pubkey(), test_master_edition.pubkey, @@ -278,8 +278,8 @@ mod freeze_delegated { ); // owner attempt to thaw account - let thaw_ix = mpl_token_metadata::instruction::thaw_delegated_account( - mpl_token_metadata::ID, + let thaw_ix = token_metadata::instruction::thaw_delegated_account( + token_metadata::ID, context.payer.pubkey(), test_metadata.token.pubkey(), test_master_edition.pubkey, diff --git a/programs/token-metadata/program/tests/lock.rs b/programs/token-metadata/program/tests/lock.rs index 72b6c686..5fcc28e5 100644 --- a/programs/token-metadata/program/tests/lock.rs +++ b/programs/token-metadata/program/tests/lock.rs @@ -8,12 +8,6 @@ use utils::*; mod lock { use borsh::BorshDeserialize; - use mpl_token_metadata::{ - error::MetadataError, - instruction::DelegateArgs, - pda::find_token_record_account, - state::{TokenRecord, TokenStandard, TokenState}, - }; use solana_program::{program_pack::Pack, pubkey::Pubkey}; use solana_sdk::{ instruction::InstructionError, @@ -21,6 +15,12 @@ mod lock { transaction::TransactionError, }; use spl_token::state::Account; + use token_metadata::{ + error::MetadataError, + instruction::DelegateArgs, + pda::find_token_record_account, + state::{TokenRecord, TokenStandard, TokenState}, + }; use super::*; diff --git a/programs/token-metadata/program/tests/mint.rs b/programs/token-metadata/program/tests/mint.rs index 315fa327..3c1795a1 100644 --- a/programs/token-metadata/program/tests/mint.rs +++ b/programs/token-metadata/program/tests/mint.rs @@ -7,10 +7,10 @@ use utils::*; mod mint { - use mpl_token_metadata::{error::MetadataError, state::TokenStandard}; use num_traits::FromPrimitive; use solana_program::program_pack::Pack; use spl_token::state::Account; + use token_metadata::{error::MetadataError, state::TokenStandard}; use super::*; diff --git a/programs/token-metadata/program/tests/mint_new_edition_from_master_edition_via_token.rs b/programs/token-metadata/program/tests/mint_new_edition_from_master_edition_via_token.rs index 4b8190c1..0410797e 100644 --- a/programs/token-metadata/program/tests/mint_new_edition_from_master_edition_via_token.rs +++ b/programs/token-metadata/program/tests/mint_new_edition_from_master_edition_via_token.rs @@ -2,12 +2,6 @@ pub mod utils; use borsh::BorshSerialize; -use mpl_token_metadata::{ - error::MetadataError, - instruction, - state::{Collection, Creator, Key, MAX_MASTER_EDITION_LEN}, - ID, -}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -16,6 +10,12 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + error::MetadataError, + instruction, + state::{Collection, Creator, Key, MAX_MASTER_EDITION_LEN}, + ID, +}; use utils::*; // NOTE: these tests depend on the token-vault program having been compiled @@ -117,7 +117,7 @@ mod mint_new_edition_from_master_edition_via_token { let tx = Transaction::new_signed_with_payer( [instruction::sign_metadata( - mpl_token_metadata::ID, + token_metadata::ID, test_metadata.pubkey, creator_pub, )] diff --git a/programs/token-metadata/program/tests/print.rs b/programs/token-metadata/program/tests/print.rs index e215eca6..c3832716 100644 --- a/programs/token-metadata/program/tests/print.rs +++ b/programs/token-metadata/program/tests/print.rs @@ -2,21 +2,21 @@ pub mod utils; use borsh::BorshSerialize; -use mpl_token_metadata::{ - error::MetadataError, - state::{Key, MAX_MASTER_EDITION_LEN}, -}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ account::AccountSharedData, instruction::InstructionError, transaction::TransactionError, }; +use token_metadata::{ + error::MetadataError, + state::{Key, MAX_MASTER_EDITION_LEN}, +}; use utils::*; mod print { use borsh::BorshDeserialize; - use mpl_token_metadata::state::{PrintSupply, TokenStandard}; + use token_metadata::state::{PrintSupply, TokenStandard}; use super::*; #[tokio::test] @@ -56,11 +56,9 @@ mod print { .await .unwrap() .unwrap(); - let edition_metadata: mpl_token_metadata::state::Metadata = - mpl_token_metadata::state::Metadata::deserialize( - &mut &edition_metadata_account.data[..], - ) - .unwrap(); + let edition_metadata: token_metadata::state::Metadata = + token_metadata::state::Metadata::deserialize(&mut &edition_metadata_account.data[..]) + .unwrap(); assert_eq!( edition_metadata.token_standard, Some(TokenStandard::ProgrammableNonFungibleEdition) diff --git a/programs/token-metadata/program/tests/process_legacy_instruction.rs b/programs/token-metadata/program/tests/process_legacy_instruction.rs index a39e7743..9dd92ca4 100644 --- a/programs/token-metadata/program/tests/process_legacy_instruction.rs +++ b/programs/token-metadata/program/tests/process_legacy_instruction.rs @@ -14,13 +14,13 @@ use utils::*; mod process_legacy_instruction { use borsh::BorshDeserialize; - use mpl_token_metadata::{ + use solana_program::program_pack::Pack; + use spl_token::state::Account; + use token_metadata::{ error::MetadataError, instruction::{sign_metadata, DelegateArgs}, state::{Metadata, TokenStandard}, }; - use solana_program::program_pack::Pack; - use spl_token::state::Account; use super::*; @@ -64,7 +64,7 @@ mod process_legacy_instruction { // we won't need to use this keypair let creator = Keypair::new(); - let sign_ix = sign_metadata(mpl_token_metadata::ID, asset.metadata, creator.pubkey()); + let sign_ix = sign_metadata(token_metadata::ID, asset.metadata, creator.pubkey()); let sign_tx = Transaction::new_signed_with_payer( &[sign_ix], Some(&context.payer.pubkey()), @@ -137,8 +137,8 @@ mod process_legacy_instruction { // tries to use a "legacy" thaw instruction with a pNFT - let thaw_ix = mpl_token_metadata::instruction::thaw_delegated_account( - mpl_token_metadata::ID, + let thaw_ix = token_metadata::instruction::thaw_delegated_account( + token_metadata::ID, delegate_pubkey, asset.token.unwrap(), asset.edition.unwrap(), @@ -169,8 +169,8 @@ mod process_legacy_instruction { // tries to freeze (this would normally fail at the SPL Token level, but we // should get our custom error first) - let freeze_ix = mpl_token_metadata::instruction::freeze_delegated_account( - mpl_token_metadata::ID, + let freeze_ix = token_metadata::instruction::freeze_delegated_account( + token_metadata::ID, delegate_pubkey, asset.token.unwrap(), asset.edition.unwrap(), diff --git a/programs/token-metadata/program/tests/revoke.rs b/programs/token-metadata/program/tests/revoke.rs index 5b572631..5e92168f 100644 --- a/programs/token-metadata/program/tests/revoke.rs +++ b/programs/token-metadata/program/tests/revoke.rs @@ -12,7 +12,11 @@ use utils::*; mod revoke { use borsh::{BorshDeserialize, BorshSerialize}; - use mpl_token_metadata::{ + use num_traits::FromPrimitive; + use solana_program::{program_option::COption, program_pack::Pack}; + use solana_sdk::account::{Account as SdkAccount, AccountSharedData}; + use spl_token::state::Account; + use token_metadata::{ error::MetadataError, instruction::{DelegateArgs, MetadataDelegateRole, RevokeArgs}, pda::{find_metadata_delegate_record_account, find_token_record_account}, @@ -21,10 +25,6 @@ mod revoke { TOKEN_RECORD_SIZE, }, }; - use num_traits::FromPrimitive; - use solana_program::{program_option::COption, program_pack::Pack}; - use solana_sdk::account::{Account as SdkAccount, AccountSharedData}; - use spl_token::state::Account; use super::*; @@ -337,7 +337,7 @@ mod revoke { #[tokio::test] async fn clear_rule_set_revision_on_delegate() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.set_compute_max_units(400_000); let mut context = program_test.start_with_context().await; @@ -480,7 +480,7 @@ mod revoke { let record_account = SdkAccount { lamports: pda.lamports, data, - owner: mpl_token_metadata::ID, + owner: token_metadata::ID, executable: false, rent_epoch: pda.rent_epoch, }; diff --git a/programs/token-metadata/program/tests/revoke_use_authority.rs b/programs/token-metadata/program/tests/revoke_use_authority.rs index e2952559..5c35acaf 100644 --- a/programs/token-metadata/program/tests/revoke_use_authority.rs +++ b/programs/token-metadata/program/tests/revoke_use_authority.rs @@ -1,19 +1,19 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ - pda::find_use_authority_account, - state::{UseAuthorityRecord, UseMethod, Uses}, -}; use solana_program_test::*; use solana_sdk::{ signature::{Keypair, Signer}, transaction::Transaction, }; +use token_metadata::{ + pda::find_use_authority_account, + state::{UseAuthorityRecord, UseMethod, Uses}, +}; use utils::*; mod revoke_use_authority { use borsh::BorshDeserialize; - use mpl_token_metadata::pda::find_program_as_burner_account; + use token_metadata::pda::find_program_as_burner_account; use super::*; #[tokio::test] @@ -46,8 +46,8 @@ mod revoke_use_authority { find_use_authority_account(&test_meta.mint.pubkey(), &use_authority.pubkey()); let (burner, _) = find_program_as_burner_account(); - let approve_ix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let approve_ix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -78,8 +78,8 @@ mod revoke_use_authority { assert_eq!(record_acct.allowed_uses, 1); - let revoke_ix = mpl_token_metadata::instruction::revoke_use_authority( - mpl_token_metadata::ID, + let revoke_ix = token_metadata::instruction::revoke_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), diff --git a/programs/token-metadata/program/tests/seralization.rs b/programs/token-metadata/program/tests/seralization.rs index 421e4584..a207aa07 100644 --- a/programs/token-metadata/program/tests/seralization.rs +++ b/programs/token-metadata/program/tests/seralization.rs @@ -1,11 +1,11 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ +use solana_program_test::*; +use token_metadata::{ state::{Key, MasterEditionV2 as ProgramME, MAX_MASTER_EDITION_LEN}, utils::try_from_slice_checked, }; -use solana_program_test::*; use utils::*; mod serialization { diff --git a/programs/token-metadata/program/tests/set_collection_size.rs b/programs/token-metadata/program/tests/set_collection_size.rs index 11eb8fa2..53c1215a 100644 --- a/programs/token-metadata/program/tests/set_collection_size.rs +++ b/programs/token-metadata/program/tests/set_collection_size.rs @@ -2,16 +2,6 @@ pub mod utils; use borsh::{BorshDeserialize, BorshSerialize}; -use mpl_token_metadata::{ - error::MetadataError, - instruction::{ - approve_collection_authority, set_collection_size, MetadataInstruction, - SetCollectionSizeArgs, - }, - pda::find_collection_authority_account, - state::{CollectionDetails, Metadata as ProgramMetadata}, - ID as PROGRAM_ID, -}; use num_traits::FromPrimitive; use solana_program::{ instruction::{AccountMeta, Instruction}, @@ -24,11 +14,21 @@ use solana_sdk::{ signer::Signer, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + error::MetadataError, + instruction::{ + approve_collection_authority, set_collection_size, MetadataInstruction, + SetCollectionSizeArgs, + }, + pda::find_collection_authority_account, + state::{CollectionDetails, Metadata as ProgramMetadata}, + ID as PROGRAM_ID, +}; use utils::*; mod set_collection_size { - use mpl_token_metadata::pda::find_collection_authority_account; + use token_metadata::pda::find_collection_authority_account; use super::*; diff --git a/programs/token-metadata/program/tests/set_token_standard.rs b/programs/token-metadata/program/tests/set_token_standard.rs index 69f4a094..b369f40c 100644 --- a/programs/token-metadata/program/tests/set_token_standard.rs +++ b/programs/token-metadata/program/tests/set_token_standard.rs @@ -2,12 +2,6 @@ pub mod utils; use borsh::{BorshDeserialize, BorshSerialize}; -use mpl_token_metadata::{ - error::MetadataError, - instruction::set_token_standard, - state::{Metadata as ProgramMetadata, TokenStandard}, - ID as PROGRAM_ID, -}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -17,6 +11,12 @@ use solana_sdk::{ signer::Signer, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + error::MetadataError, + instruction::set_token_standard, + state::{Metadata as ProgramMetadata, TokenStandard}, + ID as PROGRAM_ID, +}; use utils::*; #[tokio::test] diff --git a/programs/token-metadata/program/tests/sign_metadata.rs b/programs/token-metadata/program/tests/sign_metadata.rs index 65752234..3be82c0f 100644 --- a/programs/token-metadata/program/tests/sign_metadata.rs +++ b/programs/token-metadata/program/tests/sign_metadata.rs @@ -8,11 +8,11 @@ pub mod utils; mod sign_metadata { - use mpl_token_metadata::{ + use solana_sdk::transaction::Transaction; + use token_metadata::{ instruction::{remove_creator_verification, sign_metadata}, state::Creator, }; - use solana_sdk::transaction::Transaction; use super::*; @@ -48,7 +48,7 @@ mod sign_metadata { ) .await .unwrap(); - let sign_ix = sign_metadata(mpl_token_metadata::ID, test_meta.pubkey, creator.pubkey()); + let sign_ix = sign_metadata(token_metadata::ID, test_meta.pubkey, creator.pubkey()); let sign_tx = Transaction::new_signed_with_payer( &[sign_ix], Some(&context.payer.pubkey()), @@ -64,7 +64,7 @@ mod sign_metadata { assert!(after_sign.data.creators.unwrap()[1].verified); let remove_ix = - remove_creator_verification(mpl_token_metadata::ID, test_meta.pubkey, creator.pubkey()); + remove_creator_verification(token_metadata::ID, test_meta.pubkey, creator.pubkey()); let remove_tx = Transaction::new_signed_with_payer( &[remove_ix], Some(&context.payer.pubkey()), diff --git a/programs/token-metadata/program/tests/transfer.rs b/programs/token-metadata/program/tests/transfer.rs index 6d1460bb..ef6077ef 100644 --- a/programs/token-metadata/program/tests/transfer.rs +++ b/programs/token-metadata/program/tests/transfer.rs @@ -3,10 +3,6 @@ pub mod utils; use mpl_token_auth_rules::payload::{PayloadType, SeedsVec}; -use mpl_token_metadata::{ - instruction::TransferArgs, - state::{PayloadKey, TokenStandard}, -}; use num_traits::FromPrimitive; use rooster::instruction::DelegateArgs as RoosterDelegateArgs; use solana_program::{native_token::LAMPORTS_PER_SOL, program_pack::Pack, pubkey::Pubkey}; @@ -17,19 +13,23 @@ use solana_sdk::{ transaction::TransactionError, }; use spl_associated_token_account::get_associated_token_address; +use token_metadata::{ + instruction::TransferArgs, + state::{PayloadKey, TokenStandard}, +}; use utils::*; mod standard_transfer { - use mpl_token_metadata::{ - error::MetadataError, - instruction::{DelegateArgs, TransferArgs}, - state::TokenStandard, - }; use solana_program::{ native_token::LAMPORTS_PER_SOL, program_option::COption, program_pack::Pack, pubkey::Pubkey, }; use spl_associated_token_account::get_associated_token_address; + use token_metadata::{ + error::MetadataError, + instruction::{DelegateArgs, TransferArgs}, + state::TokenStandard, + }; use super::*; @@ -368,15 +368,15 @@ mod standard_transfer { mod auth_rules_transfer { use borsh::BorshDeserialize; use mpl_token_auth_rules::payload::Payload; - use mpl_token_metadata::{ + use solana_sdk::transaction::Transaction; + use spl_associated_token_account::instruction::create_associated_token_account; + use spl_token::instruction::approve; + use token_metadata::{ error::MetadataError, instruction::DelegateArgs, pda::find_token_record_account, state::{ProgrammableConfig, TokenDelegateRole, TokenRecord}, }; - use solana_sdk::transaction::Transaction; - use spl_associated_token_account::instruction::create_associated_token_account; - use spl_token::instruction::approve; use super::*; @@ -384,7 +384,7 @@ mod auth_rules_transfer { async fn wallet_to_wallet() { // Wallet to wallet should skip royalties rules, for now. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let mut context = program_test.start_with_context().await; @@ -500,7 +500,7 @@ mod auth_rules_transfer { #[tokio::test] async fn fail_transfer_zero_amount() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let mut context = program_test.start_with_context().await; @@ -561,17 +561,13 @@ mod auth_rules_transfer { let err = nft.transfer(params).await.unwrap_err(); - assert_custom_error_ix!( - 2, - err, - mpl_token_metadata::error::MetadataError::InvalidAmount - ); + assert_custom_error_ix!(2, err, token_metadata::error::MetadataError::InvalidAmount); } #[tokio::test] async fn owner_transfer() { // Tests an owner transferring from a system wallet to a PDA and vice versa. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); let mut context = program_test.start_with_context().await; @@ -711,7 +707,7 @@ mod auth_rules_transfer { #[tokio::test] async fn transfer_delegate() { // Tests a delegate transferring from a system wallet to a PDA and vice versa. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); program_test.set_compute_max_units(400_000); @@ -878,7 +874,7 @@ mod auth_rules_transfer { #[tokio::test] async fn transfer_delegate_wrong_metadata() { // Tests a delegate transferring from a system wallet to a PDA and vice versa. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); program_test.set_compute_max_units(400_000); @@ -981,7 +977,7 @@ mod auth_rules_transfer { #[tokio::test] async fn sale_delegate() { // Tests a delegate transferring from a system wallet to a PDA and vice versa. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); program_test.set_compute_max_units(400_000); @@ -1162,7 +1158,7 @@ mod auth_rules_transfer { // the delegate to close the account. This test ensures that the CloseAuthority // is cleared after the transfer along with the rest of the delegate data. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); program_test.set_compute_max_units(400_000); @@ -1276,7 +1272,7 @@ mod auth_rules_transfer { async fn no_auth_rules_skips_validation() { // Tests a pNFT with a rule_set of None skipping validation and still being // transferred correctly. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let mut context = program_test.start_with_context().await; @@ -1326,7 +1322,7 @@ mod auth_rules_transfer { #[tokio::test] async fn locked_transfer_delegate() { // tests a LockedTransfer delegate, which works similarly to a Transfer delegate - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); program_test.set_compute_max_units(400_000); @@ -1454,7 +1450,7 @@ mod auth_rules_transfer { #[tokio::test] async fn escrowless_delegate_transfer() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); let mut context = program_test.start_with_context().await; @@ -1558,7 +1554,7 @@ mod auth_rules_transfer { // We ensure that the destination owner is linked to the destination token account // so that people cannot get around auth rules by passing in an owner that is in an allowlist // but doesn't actually correspond to the token account. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let mut context = program_test.start_with_context().await; @@ -1650,7 +1646,7 @@ mod auth_rules_transfer { #[tokio::test] async fn invalid_close_authority_fails() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let mut context = program_test.start_with_context().await; @@ -1726,7 +1722,7 @@ mod auth_rules_transfer { #[tokio::test] async fn clear_delegate_after_holder_transfer() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.add_program("rooster", rooster::ID, None); let mut context = program_test.start_with_context().await; @@ -1819,7 +1815,7 @@ mod auth_rules_transfer { #[tokio::test] async fn delegate_on_destination_transfer_fails() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let mut context = program_test.start_with_context().await; diff --git a/programs/token-metadata/program/tests/unlock.rs b/programs/token-metadata/program/tests/unlock.rs index 2a095f4e..8c2ccaf2 100644 --- a/programs/token-metadata/program/tests/unlock.rs +++ b/programs/token-metadata/program/tests/unlock.rs @@ -7,14 +7,14 @@ use utils::*; mod utility { use borsh::BorshDeserialize; - use mpl_token_metadata::{ + use solana_program::{program_pack::Pack, pubkey::Pubkey}; + use solana_sdk::signature::{Keypair, Signer}; + use spl_token::state::Account; + use token_metadata::{ instruction::DelegateArgs, pda::find_token_record_account, state::{TokenDelegateRole, TokenRecord, TokenStandard, TokenState}, }; - use solana_program::{program_pack::Pack, pubkey::Pubkey}; - use solana_sdk::signature::{Keypair, Signer}; - use spl_token::state::Account; use super::*; diff --git a/programs/token-metadata/program/tests/unverify.rs b/programs/token-metadata/program/tests/unverify.rs index 5dfe0d25..03b5c87c 100644 --- a/programs/token-metadata/program/tests/unverify.rs +++ b/programs/token-metadata/program/tests/unverify.rs @@ -2,12 +2,6 @@ pub mod utils; -use mpl_token_metadata::{ - error::MetadataError, - instruction::{BurnArgs, DelegateArgs, MetadataDelegateRole, UpdateArgs, VerificationArgs}, - pda::{find_metadata_delegate_record_account, find_token_record_account}, - state::{Collection, CollectionDetails, Creator, TokenStandard}, -}; use num_traits::FromPrimitive; use solana_program::native_token::LAMPORTS_PER_SOL; use solana_program_test::*; @@ -15,6 +9,12 @@ use solana_sdk::{ instruction::InstructionError, signature::Keypair, signer::Signer, transaction::TransactionError, }; +use token_metadata::{ + error::MetadataError, + instruction::{BurnArgs, DelegateArgs, MetadataDelegateRole, UpdateArgs, VerificationArgs}, + pda::{find_metadata_delegate_record_account, find_token_record_account}, + state::{Collection, CollectionDetails, Creator, TokenStandard}, +}; use utils::*; mod unverify_creator { diff --git a/programs/token-metadata/program/tests/update.rs b/programs/token-metadata/program/tests/update.rs index 1c5ca3d2..245f12eb 100644 --- a/programs/token-metadata/program/tests/update.rs +++ b/programs/token-metadata/program/tests/update.rs @@ -1,16 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ - error::MetadataError, - instruction::{ - builders::UpdateBuilder, CollectionToggle, DelegateArgs, InstructionBuilder, RuleSetToggle, - TransferArgs, UpdateArgs, - }, - state::{Collection, Creator, Data, ProgrammableConfig, TokenStandard}, - state::{MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH}, - utils::puffed_out_string, -}; use num_traits::FromPrimitive; use solana_program::{program_pack::Pack, pubkey::Pubkey}; use solana_program_test::*; @@ -21,6 +11,16 @@ use solana_sdk::{ transaction::{Transaction, TransactionError}, }; use spl_token::state::Account; +use token_metadata::{ + error::MetadataError, + instruction::{ + builders::UpdateBuilder, CollectionToggle, DelegateArgs, InstructionBuilder, RuleSetToggle, + TransferArgs, UpdateArgs, + }, + state::{Collection, Creator, Data, ProgrammableConfig, TokenStandard}, + state::{MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH}, + utils::puffed_out_string, +}; use utils::{DigitalAsset, *}; mod update { @@ -404,7 +404,7 @@ mod update { #[tokio::test] async fn success_update_pfnt_config_by_update_authority() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -477,7 +477,7 @@ mod update { #[tokio::test] async fn fail_update_pfnt_config_no_token_in_account() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -596,7 +596,7 @@ mod update { #[tokio::test] async fn fail_update_pfnt_config_token_and_mint_mismatch() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -696,7 +696,7 @@ mod update { #[tokio::test] async fn fail_update_pfnt_config_metadata_and_mint_mismatch() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -796,7 +796,7 @@ mod update { #[tokio::test] async fn fail_update_pfnt_config_by_update_authority_wrong_edition() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -932,7 +932,7 @@ mod update { delegate_args: DelegateArgs, update_args: UpdateArgs, ) { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -1070,7 +1070,7 @@ mod update { } async fn fail_update_by_items_delegate(delegate_args: DelegateArgs) { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -1143,7 +1143,7 @@ mod update { #[tokio::test] async fn fail_update_by_items_persistent_delegate() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -1213,7 +1213,7 @@ mod update { #[tokio::test] async fn fail_update_by_holder() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -2169,7 +2169,7 @@ mod update { async fn success_update_prog_config_by_collections_prog_config_delegate( update_args: UpdateArgs, ) { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -2271,7 +2271,7 @@ mod update { #[tokio::test] async fn success_update_data_by_collections_data_delegate() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -2402,7 +2402,7 @@ mod update { #[tokio::test] async fn fail_update_prog_config_by_col_prog_config_delegate_wrong_v1_args() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -2514,7 +2514,7 @@ mod update { #[tokio::test] async fn fail_update_by_col_prog_config_delegate_using_new_collection_in_v1_args() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -2632,7 +2632,7 @@ mod update { // prevent it from being updated again because it either won't be owned by the mpl-token-auth rules // program or it won't be a valid rule set to call validate on. // We relax the check a little to let users fix invalid rule sets. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -2788,7 +2788,7 @@ mod update { #[tokio::test] async fn cannot_update_rule_set_when_delegate_set() { // When a delegate is set, the rule set cannot be updated. - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); program_test.set_compute_max_units(400_000); let context = &mut program_test.start_with_context().await; @@ -3340,7 +3340,7 @@ mod update { #[tokio::test] async fn fail_update_data_by_collections_collection_delegate() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; @@ -3486,7 +3486,7 @@ mod update { #[tokio::test] async fn fail_update_prog_config_by_collections_collection_delegate() { - let mut program_test = ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None); + let mut program_test = ProgramTest::new("token_metadata", token_metadata::ID, None); program_test.add_program("mpl_token_auth_rules", mpl_token_auth_rules::ID, None); let context = &mut program_test.start_with_context().await; diff --git a/programs/token-metadata/program/tests/update_metadata_account_v2.rs b/programs/token-metadata/program/tests/update_metadata_account_v2.rs index 70fba11a..d7f2bcb6 100644 --- a/programs/token-metadata/program/tests/update_metadata_account_v2.rs +++ b/programs/token-metadata/program/tests/update_metadata_account_v2.rs @@ -1,7 +1,14 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ +use num_traits::FromPrimitive; +use solana_program_test::*; +use solana_sdk::{ + instruction::InstructionError, + signature::{Keypair, Signer}, + transaction::{Transaction, TransactionError}, +}; +use token_metadata::{ error::MetadataError, instruction, state::{ @@ -11,17 +18,10 @@ use mpl_token_metadata::{ utils::puffed_out_string, ID, }; -use num_traits::FromPrimitive; -use solana_program_test::*; -use solana_sdk::{ - instruction::InstructionError, - signature::{Keypair, Signer}, - transaction::{Transaction, TransactionError}, -}; use utils::*; mod update_metadata_account_v2 { - use mpl_token_metadata::pda::find_collection_authority_account; + use token_metadata::pda::find_collection_authority_account; use super::*; @@ -173,8 +173,8 @@ mod update_metadata_account_v2 { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -493,8 +493,8 @@ mod update_metadata_account_v2 { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, diff --git a/programs/token-metadata/program/tests/update_primary_sale_happened_via_token.rs b/programs/token-metadata/program/tests/update_primary_sale_happened_via_token.rs index 36437643..916c0791 100644 --- a/programs/token-metadata/program/tests/update_primary_sale_happened_via_token.rs +++ b/programs/token-metadata/program/tests/update_primary_sale_happened_via_token.rs @@ -1,13 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ - error::MetadataError, - instruction, - state::{Key, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH}, - utils::puffed_out_string, - ID, -}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -15,11 +8,18 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + error::MetadataError, + instruction, + state::{Key, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH}, + utils::puffed_out_string, + ID, +}; use utils::*; mod update_primary_sale_happened_via_token { - use mpl_token_metadata::state::Creator; + use token_metadata::state::Creator; use super::*; #[tokio::test] diff --git a/programs/token-metadata/program/tests/uses.rs b/programs/token-metadata/program/tests/uses.rs index c9648f2d..6c24a0e9 100644 --- a/programs/token-metadata/program/tests/uses.rs +++ b/programs/token-metadata/program/tests/uses.rs @@ -1,7 +1,6 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::state::{UseMethod, Uses}; use num_traits::FromPrimitive; use solana_program_test::*; use solana_sdk::{ @@ -9,18 +8,19 @@ use solana_sdk::{ signature::Signer, transaction::{Transaction, TransactionError}, }; +use token_metadata::state::{UseMethod, Uses}; use utils::*; mod uses { use borsh::BorshDeserialize; - use mpl_token_metadata::{ + use solana_program::program_pack::Pack; + use solana_sdk::signature::Keypair; + use spl_token::state::Account; + use token_metadata::{ error::MetadataError, pda::{find_program_as_burner_account, find_use_authority_account}, state::{Key, UseAuthorityRecord}, }; - use solana_program::program_pack::Pack; - use solana_sdk::signature::Keypair; - use spl_token::state::Account; use super::*; @@ -52,8 +52,8 @@ mod uses { .await .unwrap(); - let ix = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), @@ -112,8 +112,8 @@ mod uses { .await .unwrap(); - let ix = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), @@ -168,8 +168,8 @@ mod uses { .await .unwrap(); - let ix = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), @@ -229,8 +229,8 @@ mod uses { find_use_authority_account(&test_metadata.mint.pubkey(), &use_authority.pubkey()); let (burner, _) = find_program_as_burner_account(); - let add_use_authority = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let add_use_authority = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -255,8 +255,8 @@ mod uses { .await .unwrap(); - let utilize_with_use_authority = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let utilize_with_use_authority = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), @@ -315,8 +315,8 @@ mod uses { find_use_authority_account(&test_metadata.mint.pubkey(), &use_authority.pubkey()); let (burner, _) = find_program_as_burner_account(); - let add_use_authority = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let add_use_authority = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -341,8 +341,8 @@ mod uses { .await .unwrap(); - let utilize_with_use_authority = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let utilize_with_use_authority = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), @@ -366,8 +366,8 @@ mod uses { .await .unwrap(); - let revoke_use_authority = mpl_token_metadata::instruction::revoke_use_authority( - mpl_token_metadata::ID, + let revoke_use_authority = token_metadata::instruction::revoke_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -390,8 +390,8 @@ mod uses { .unwrap(); context.warp_to_slot(100).unwrap(); - let utilize_with_use_authority_fail = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let utilize_with_use_authority_fail = token_metadata::instruction::utilize( + token_metadata::ID, test_metadata.pubkey, test_metadata.token.pubkey(), test_metadata.mint.pubkey(), @@ -453,8 +453,8 @@ mod uses { let (record, _) = find_use_authority_account(&test_meta.mint.pubkey(), &use_authority.pubkey()); let (burner, _) = find_program_as_burner_account(); - let approveix = mpl_token_metadata::instruction::approve_use_authority( - mpl_token_metadata::ID, + let approveix = token_metadata::instruction::approve_use_authority( + token_metadata::ID, record, use_authority.pubkey(), context.payer.pubkey(), @@ -482,8 +482,8 @@ mod uses { assert_eq!(record_acct.key, Key::UseAuthorityRecord); assert_eq!(record_acct.allowed_uses, 1); - let utilize_ix = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let utilize_ix = token_metadata::instruction::utilize( + token_metadata::ID, test_meta.pubkey, test_meta.token.pubkey(), test_meta.mint.pubkey(), @@ -540,8 +540,8 @@ mod uses { .await .unwrap(); - let utilize_ix = mpl_token_metadata::instruction::utilize( - mpl_token_metadata::ID, + let utilize_ix = token_metadata::instruction::utilize( + token_metadata::ID, test_meta.pubkey, test_meta.token.pubkey(), test_meta.mint.pubkey(), diff --git a/programs/token-metadata/program/tests/utils/collection.rs b/programs/token-metadata/program/tests/utils/collection.rs index 12849b30..b0b1bd7e 100644 --- a/programs/token-metadata/program/tests/utils/collection.rs +++ b/programs/token-metadata/program/tests/utils/collection.rs @@ -1,9 +1,9 @@ use crate::*; -use mpl_token_metadata::{ +use solana_program::borsh::try_from_slice_unchecked; +use token_metadata::{ id, instruction, state::{Collection, Creator, Data, DataV2, Uses, PREFIX}, }; -use solana_program::borsh::try_from_slice_unchecked; use solana_sdk::{ pubkey::Pubkey, signature::Signer, signer::keypair::Keypair, transaction::Transaction, diff --git a/programs/token-metadata/program/tests/utils/digital_asset.rs b/programs/token-metadata/program/tests/utils/digital_asset.rs index 0520ed7b..ecc9543b 100644 --- a/programs/token-metadata/program/tests/utils/digital_asset.rs +++ b/programs/token-metadata/program/tests/utils/digital_asset.rs @@ -1,5 +1,17 @@ use borsh::BorshDeserialize; -use mpl_token_metadata::{ +use solana_program::{program_option::COption, program_pack::Pack, pubkey::Pubkey}; +use solana_program_test::{BanksClientError, ProgramTestContext}; +use solana_sdk::{ + account::AccountSharedData, + compute_budget::ComputeBudgetInstruction, + signature::{Keypair, Signer}, + transaction::Transaction, +}; +use spl_associated_token_account::{ + get_associated_token_address, instruction::create_associated_token_account, +}; +use spl_token::state::Account; +use token_metadata::{ instruction::{ self, builders::{ @@ -23,18 +35,6 @@ use mpl_token_metadata::{ }, ID, }; -use solana_program::{program_option::COption, program_pack::Pack, pubkey::Pubkey}; -use solana_program_test::{BanksClientError, ProgramTestContext}; -use solana_sdk::{ - account::AccountSharedData, - compute_budget::ComputeBudgetInstruction, - signature::{Keypair, Signer}, - transaction::Transaction, -}; -use spl_associated_token_account::{ - get_associated_token_address, instruction::create_associated_token_account, -}; -use spl_token::state::Account; use super::{airdrop, create_mint, create_token_account, get_account, mint_tokens}; @@ -118,12 +118,12 @@ impl DigitalAsset { let (edition_marker, _) = Pubkey::find_program_address( &[ PREFIX.as_bytes(), - mpl_token_metadata::ID.as_ref(), + token_metadata::ID.as_ref(), parent_asset.mint.pubkey().as_ref(), EDITION.as_bytes(), marker_num.to_string().as_bytes(), ], - &mpl_token_metadata::ID, + &token_metadata::ID, ); builder.edition_marker(edition_marker); } diff --git a/programs/token-metadata/program/tests/utils/edition_marker.rs b/programs/token-metadata/program/tests/utils/edition_marker.rs index 25baed53..64262e07 100644 --- a/programs/token-metadata/program/tests/utils/edition_marker.rs +++ b/programs/token-metadata/program/tests/utils/edition_marker.rs @@ -1,15 +1,4 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use mpl_token_metadata::{ - instruction::{ - self, - builders::{BurnBuilder, DelegateBuilder, PrintBuilder, TransferBuilder}, - BurnArgs, DelegateArgs, InstructionBuilder, MetadataDelegateRole, MetadataInstruction, - MintNewEditionFromMasterEditionViaTokenArgs, PrintArgs, TransferArgs, - }, - pda::{find_metadata_delegate_record_account, find_token_record_account, MARKER}, - state::{ProgrammableConfig, TokenMetadataAccount, EDITION, EDITION_MARKER_BIT_SIZE, PREFIX}, - ID, -}; use solana_program::{ instruction::{AccountMeta, Instruction}, system_program, sysvar, @@ -22,6 +11,17 @@ use solana_sdk::{ use spl_associated_token_account::{ get_associated_token_address, instruction::create_associated_token_account, }; +use token_metadata::{ + instruction::{ + self, + builders::{BurnBuilder, DelegateBuilder, PrintBuilder, TransferBuilder}, + BurnArgs, DelegateArgs, InstructionBuilder, MetadataDelegateRole, MetadataInstruction, + MintNewEditionFromMasterEditionViaTokenArgs, PrintArgs, TransferArgs, + }, + pda::{find_metadata_delegate_record_account, find_token_record_account, MARKER}, + state::{ProgrammableConfig, TokenMetadataAccount, EDITION, EDITION_MARKER_BIT_SIZE, PREFIX}, + ID, +}; use crate::*; @@ -162,7 +162,7 @@ impl EditionMarker { pub async fn get_data( &self, context: &mut ProgramTestContext, - ) -> mpl_token_metadata::state::EditionMarker { + ) -> token_metadata::state::EditionMarker { let account = get_account(context, &self.pubkey).await; BorshDeserialize::deserialize(&mut &account.data[..]).unwrap() } @@ -170,7 +170,7 @@ impl EditionMarker { pub async fn get_data_v2( &self, context: &mut ProgramTestContext, - ) -> mpl_token_metadata::state::EditionMarkerV2 { + ) -> token_metadata::state::EditionMarkerV2 { let account = get_account(context, &self.pubkey).await; BorshDeserialize::deserialize(&mut &account.data[..]).unwrap() } @@ -263,16 +263,16 @@ impl EditionMarker { let edition_marker_pda = Pubkey::find_program_address( &[ PREFIX.as_bytes(), - mpl_token_metadata::ID.as_ref(), + token_metadata::ID.as_ref(), self.metadata_mint_pubkey.as_ref(), EDITION.as_bytes(), MARKER.as_bytes(), ], - &mpl_token_metadata::ID, + &token_metadata::ID, ); let token_record_pda = find_token_record_account(&self.mint.pubkey(), &self.token.pubkey()); - let master_metadata = mpl_token_metadata::state::Metadata::safe_deserialize( + let master_metadata = token_metadata::state::Metadata::safe_deserialize( &get_account(context, &self.metadata_pubkey).await.data, ) .unwrap(); @@ -327,12 +327,12 @@ impl EditionMarker { let edition_marker_pda = Pubkey::find_program_address( &[ PREFIX.as_bytes(), - mpl_token_metadata::ID.as_ref(), + token_metadata::ID.as_ref(), self.metadata_mint_pubkey.as_ref(), EDITION.as_bytes(), MARKER.as_bytes(), ], - &mpl_token_metadata::ID, + &token_metadata::ID, ); let edition_ata = @@ -383,7 +383,7 @@ impl EditionMarker { context: &mut ProgramTestContext, ) -> Result<(), BanksClientError> { let fake_token_program = Keypair::new(); - let program_id = mpl_token_metadata::ID; + let program_id = token_metadata::ID; let edition_number = self.edition.checked_div(EDITION_MARKER_BIT_SIZE).unwrap(); let as_string = edition_number.to_string(); @@ -728,9 +728,8 @@ impl EditionMarker { // determines if we need to set the rule set let metadata_account = get_account(context, &self.metadata_pubkey).await; - let metadata: mpl_token_metadata::state::Metadata = - mpl_token_metadata::state::Metadata::deserialize(&mut &metadata_account.data[..]) - .unwrap(); + let metadata: token_metadata::state::Metadata = + token_metadata::state::Metadata::deserialize(&mut &metadata_account.data[..]).unwrap(); if let Some(ProgrammableConfig::V1 { rule_set: Some(rule_set), diff --git a/programs/token-metadata/program/tests/utils/master_edition_v2.rs b/programs/token-metadata/program/tests/utils/master_edition_v2.rs index 04bb6580..3f325e0a 100644 --- a/programs/token-metadata/program/tests/utils/master_edition_v2.rs +++ b/programs/token-metadata/program/tests/utils/master_edition_v2.rs @@ -1,9 +1,4 @@ use borsh::{ser::BorshSerialize, BorshDeserialize}; -use mpl_token_metadata::{ - instruction::{self, CreateMasterEditionArgs, MetadataInstruction}, - state::{MasterEditionV2 as ProgramMasterEdition, TokenMetadataAccount, EDITION, PREFIX}, - ID, -}; use solana_program::{ instruction::{AccountMeta, Instruction}, sysvar, @@ -13,6 +8,11 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::Transaction, }; +use token_metadata::{ + instruction::{self, CreateMasterEditionArgs, MetadataInstruction}, + state::{MasterEditionV2 as ProgramMasterEdition, TokenMetadataAccount, EDITION, PREFIX}, + ID, +}; use crate::*; @@ -65,7 +65,7 @@ impl MasterEditionV2 { pub async fn get_data( &self, context: &mut ProgramTestContext, - ) -> mpl_token_metadata::state::MasterEditionV2 { + ) -> token_metadata::state::MasterEditionV2 { let account = get_account(context, &self.pubkey).await; ProgramMasterEdition::safe_deserialize(&account.data).unwrap() } @@ -73,7 +73,7 @@ impl MasterEditionV2 { pub async fn get_data_from_account( context: &mut ProgramTestContext, pubkey: &Pubkey, - ) -> mpl_token_metadata::state::MasterEditionV2 { + ) -> token_metadata::state::MasterEditionV2 { let account = get_account(context, pubkey).await; BorshDeserialize::deserialize(&mut &account.data[..]).unwrap() } @@ -86,7 +86,7 @@ impl MasterEditionV2 { let fake_token_program = Keypair::new(); let fake_instruction = Instruction { - program_id: mpl_token_metadata::ID, + program_id: token_metadata::ID, accounts: vec![ AccountMeta::new(self.pubkey, false), AccountMeta::new(self.mint_pubkey, false), diff --git a/programs/token-metadata/program/tests/utils/metadata.rs b/programs/token-metadata/program/tests/utils/metadata.rs index becb4d76..5cd2b91f 100644 --- a/programs/token-metadata/program/tests/utils/metadata.rs +++ b/programs/token-metadata/program/tests/utils/metadata.rs @@ -1,5 +1,8 @@ use borsh::BorshDeserialize; -use mpl_token_metadata::{ +use solana_sdk::{ + pubkey::Pubkey, signature::Signer, signer::keypair::Keypair, transaction::Transaction, +}; +use token_metadata::{ instruction, state::{ Collection, CollectionDetails, Creator, DataV2, Metadata as TmMetadata, @@ -8,9 +11,6 @@ use mpl_token_metadata::{ }, ID, }; -use solana_sdk::{ - pubkey::Pubkey, signature::Signer, signer::keypair::Keypair, transaction::Transaction, -}; use crate::*; @@ -64,7 +64,7 @@ impl Metadata { pub async fn get_data( &self, context: &mut ProgramTestContext, - ) -> mpl_token_metadata::state::Metadata { + ) -> token_metadata::state::Metadata { let account = get_account(context, &self.pubkey).await; BorshDeserialize::deserialize(&mut &account.data[..]).unwrap() } @@ -631,7 +631,7 @@ impl Metadata { let tx = Transaction::new_signed_with_payer( &[instruction::update_metadata_accounts_v2( - mpl_token_metadata::ID, + token_metadata::ID, self.pubkey, context.payer.pubkey(), Some(new_update_authority), diff --git a/programs/token-metadata/program/tests/utils/mod.rs b/programs/token-metadata/program/tests/utils/mod.rs index 03f30287..299e162f 100644 --- a/programs/token-metadata/program/tests/utils/mod.rs +++ b/programs/token-metadata/program/tests/utils/mod.rs @@ -12,8 +12,6 @@ pub use digital_asset::*; pub use edition_marker::*; pub use master_edition_v2::MasterEditionV2; pub use metadata::{assert_collection_size, Metadata}; -pub use mpl_token_metadata::instruction; -use mpl_token_metadata::state::CollectionDetails; pub use programmable::create_default_metaplex_rule_set; pub use rooster_manager::*; use solana_program_test::*; @@ -22,6 +20,8 @@ use solana_sdk::{ signer::keypair::Keypair, system_instruction, transaction::Transaction, }; use spl_token::state::Mint; +pub use token_metadata::instruction; +use token_metadata::state::CollectionDetails; pub const DEFAULT_COLLECTION_DETAILS: Option = { #[allow(deprecated)] @@ -29,7 +29,7 @@ pub const DEFAULT_COLLECTION_DETAILS: Option = { }; pub fn program_test() -> ProgramTest { - ProgramTest::new("mpl_token_metadata", mpl_token_metadata::ID, None) + ProgramTest::new("token_metadata", token_metadata::ID, None) } pub async fn get_account(context: &mut ProgramTestContext, pubkey: &Pubkey) -> Account { @@ -77,7 +77,7 @@ pub async fn burn( ) -> Result<(), BanksClientError> { let tx = Transaction::new_signed_with_payer( &[instruction::burn_nft( - mpl_token_metadata::ID, + token_metadata::ID, metadata, owner.pubkey(), mint, @@ -110,7 +110,7 @@ pub async fn burn_edition( ) -> Result<(), BanksClientError> { let tx = Transaction::new_signed_with_payer( &[instruction::burn_edition_nft( - mpl_token_metadata::ID, + token_metadata::ID, metadata, owner.pubkey(), print_edition_mint, diff --git a/programs/token-metadata/program/tests/utils/programmable.rs b/programs/token-metadata/program/tests/utils/programmable.rs index 6d0cc921..5231f8c9 100644 --- a/programs/token-metadata/program/tests/utils/programmable.rs +++ b/programs/token-metadata/program/tests/utils/programmable.rs @@ -3,10 +3,6 @@ use mpl_token_auth_rules::{ payload::Payload, state::{CompareOp, Rule, RuleSetV1}, }; -use mpl_token_metadata::{ - processor::{AuthorizationData, DelegateScenario, TransferScenario}, - state::{Operation, PayloadKey, TokenDelegateRole}, -}; use rmp_serde::Serializer; use serde::Serialize; use solana_sdk::{ @@ -15,6 +11,10 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::Transaction, }; +use token_metadata::{ + processor::{AuthorizationData, DelegateScenario, TransferScenario}, + state::{Operation, PayloadKey, TokenDelegateRole}, +}; use crate::*; diff --git a/programs/token-metadata/program/tests/verify.rs b/programs/token-metadata/program/tests/verify.rs index fb9a9979..9f9ce1f0 100644 --- a/programs/token-metadata/program/tests/verify.rs +++ b/programs/token-metadata/program/tests/verify.rs @@ -2,7 +2,14 @@ pub mod utils; -use mpl_token_metadata::{ +use num_traits::FromPrimitive; +use solana_program::native_token::LAMPORTS_PER_SOL; +use solana_program_test::*; +use solana_sdk::{ + instruction::InstructionError, signature::Keypair, signer::Signer, transaction::Transaction, + transaction::TransactionError, +}; +use token_metadata::{ error::MetadataError, instruction::{ builders::VerifyBuilder, DelegateArgs, InstructionBuilder, MetadataDelegateRole, @@ -11,13 +18,6 @@ use mpl_token_metadata::{ pda::{find_metadata_delegate_record_account, find_token_record_account}, state::{Collection, CollectionDetails, Creator, TokenStandard}, }; -use num_traits::FromPrimitive; -use solana_program::native_token::LAMPORTS_PER_SOL; -use solana_program_test::*; -use solana_sdk::{ - instruction::InstructionError, signature::Keypair, signer::Signer, transaction::Transaction, - transaction::TransactionError, -}; use utils::*; mod verify_creator { diff --git a/programs/token-metadata/program/tests/verify_collection.rs b/programs/token-metadata/program/tests/verify_collection.rs index c556cfec..66e31149 100644 --- a/programs/token-metadata/program/tests/verify_collection.rs +++ b/programs/token-metadata/program/tests/verify_collection.rs @@ -2,15 +2,6 @@ pub mod utils; use borsh::BorshDeserialize; -use mpl_token_metadata::{ - error::MetadataError, - pda::find_collection_authority_account, - state::{ - Collection, CollectionAuthorityRecord, Key, UseMethod, Uses, - COLLECTION_AUTHORITY_RECORD_SIZE, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH, - }, - utils::puffed_out_string, -}; use num_traits::FromPrimitive; use solana_program::native_token::LAMPORTS_PER_SOL; use solana_program_test::*; @@ -20,12 +11,21 @@ use solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, }; +use token_metadata::{ + error::MetadataError, + pda::find_collection_authority_account, + state::{ + Collection, CollectionAuthorityRecord, Key, UseMethod, Uses, + COLLECTION_AUTHORITY_RECORD_SIZE, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH, + }, + utils::puffed_out_string, +}; use utils::*; mod verify_collection { use borsh::BorshDeserialize; - use mpl_token_metadata::state::{CollectionAuthorityRecord, COLLECTION_AUTHORITY_RECORD_SIZE}; use solana_sdk::transaction::Transaction; + use token_metadata::state::{CollectionAuthorityRecord, COLLECTION_AUTHORITY_RECORD_SIZE}; use super::*; #[tokio::test] @@ -548,8 +548,8 @@ mod verify_collection { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), context.payer.pubkey(), @@ -632,8 +632,8 @@ mod verify_collection { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -721,8 +721,8 @@ mod verify_collection { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -765,8 +765,8 @@ mod verify_collection { ); assert!(metadata_after.collection.unwrap().verified); - let ix_revoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ix_revoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), new_collection_authority.pubkey(), @@ -842,8 +842,8 @@ mod verify_collection { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), context.payer.pubkey(), @@ -869,8 +869,8 @@ mod verify_collection { .unwrap(); assert_eq!(account_before.data.len(), COLLECTION_AUTHORITY_RECORD_SIZE); - let ixrevoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ixrevoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), context.payer.pubkey(), @@ -946,8 +946,8 @@ mod verify_collection { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -1004,8 +1004,8 @@ mod verify_collection { let metadata_after_unverify = test_metadata.get_data(&mut context).await; assert!(!metadata_after_unverify.collection.unwrap().verified); - let ix_revoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ix_revoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), incorrect_revoke_authority.pubkey(), @@ -1231,8 +1231,8 @@ async fn fail_invalid_collection_update_authority() { &delegate_keypair.pubkey(), ); - let ix1 = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix1 = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, delegate_keypair.pubkey(), update_authority, @@ -1311,7 +1311,7 @@ async fn success_collection_authority_delegate_revoke() { let record_account = Account { lamports: LAMPORTS_PER_SOL, data, - owner: mpl_token_metadata::ID, + owner: token_metadata::ID, executable: false, rent_epoch: 1, }; @@ -1320,8 +1320,8 @@ async fn success_collection_authority_delegate_revoke() { let payer = context.payer.pubkey(); - let ix_revoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ix_revoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, delegate_keypair.pubkey(), payer, @@ -1342,8 +1342,8 @@ async fn success_collection_authority_delegate_revoke() { .await .unwrap(); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, delegate_keypair.pubkey(), payer, diff --git a/programs/token-metadata/program/tests/verify_sized_collection_item.rs b/programs/token-metadata/program/tests/verify_sized_collection_item.rs index 9bd13e6a..ef6d7cbe 100644 --- a/programs/token-metadata/program/tests/verify_sized_collection_item.rs +++ b/programs/token-metadata/program/tests/verify_sized_collection_item.rs @@ -1,7 +1,14 @@ #![cfg(feature = "test-bpf")] pub mod utils; -use mpl_token_metadata::{ +use num_traits::FromPrimitive; +use solana_program_test::*; +use solana_sdk::{ + instruction::InstructionError, + signature::{Keypair, Signer}, + transaction::{Transaction, TransactionError}, +}; +use token_metadata::{ error::MetadataError, instruction::set_collection_size, pda::find_collection_authority_account, @@ -12,19 +19,12 @@ use mpl_token_metadata::{ utils::puffed_out_string, ID as PROGRAM_ID, }; -use num_traits::FromPrimitive; -use solana_program_test::*; -use solana_sdk::{ - instruction::InstructionError, - signature::{Keypair, Signer}, - transaction::{Transaction, TransactionError}, -}; use utils::*; mod verify_sized_collection_item { use borsh::BorshDeserialize; - use mpl_token_metadata::state::{CollectionAuthorityRecord, COLLECTION_AUTHORITY_RECORD_SIZE}; use solana_sdk::transaction::Transaction; + use token_metadata::state::{CollectionAuthorityRecord, COLLECTION_AUTHORITY_RECORD_SIZE}; use super::*; #[tokio::test] @@ -579,8 +579,8 @@ mod verify_sized_collection_item { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), context.payer.pubkey(), @@ -674,8 +674,8 @@ mod verify_sized_collection_item { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -773,8 +773,8 @@ mod verify_sized_collection_item { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -817,8 +817,8 @@ mod verify_sized_collection_item { ); assert!(metadata_after.collection.unwrap().verified); - let ix_revoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ix_revoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), new_collection_authority.pubkey(), @@ -894,8 +894,8 @@ mod verify_sized_collection_item { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), context.payer.pubkey(), @@ -921,8 +921,8 @@ mod verify_sized_collection_item { .unwrap(); assert_eq!(account_before.data.len(), COLLECTION_AUTHORITY_RECORD_SIZE); - let ixrevoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ixrevoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), context.payer.pubkey(), @@ -1009,8 +1009,8 @@ mod verify_sized_collection_item { &test_collection.mint.pubkey(), &new_collection_authority.pubkey(), ); - let ix = mpl_token_metadata::instruction::approve_collection_authority( - mpl_token_metadata::ID, + let ix = token_metadata::instruction::approve_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), update_authority, @@ -1067,8 +1067,8 @@ mod verify_sized_collection_item { let metadata_after_unverify = test_metadata.get_data(&mut context).await; assert!(!metadata_after_unverify.collection.unwrap().verified); - let ix_revoke = mpl_token_metadata::instruction::revoke_collection_authority( - mpl_token_metadata::ID, + let ix_revoke = token_metadata::instruction::revoke_collection_authority( + token_metadata::ID, record, new_collection_authority.pubkey(), incorrect_revoke_authority.pubkey(), From eb5b020070914e3f59e371329eabee291ef065a5 Mon Sep 17 00:00:00 2001 From: febo Date: Sun, 20 Aug 2023 12:44:20 +0000 Subject: [PATCH 12/31] Update generated clients --- .../accounts/collectionAuthorityRecord.ts | 4 +- clients/js/src/generated/accounts/edition.ts | 2 +- .../src/generated/accounts/editionMarker.ts | 4 +- .../src/generated/accounts/editionMarkerV2.ts | 2 +- clients/js/src/generated/accounts/index.ts | 3 + .../src/generated/accounts/masterEdition.ts | 4 +- .../src/generated/accounts/masterEditionV1.ts | 172 ++++++++++++++++ clients/js/src/generated/accounts/metadata.ts | 4 +- .../accounts/metadataDelegateRecord.ts | 4 +- .../generated/accounts/reservationListV1.ts | 180 +++++++++++++++++ .../generated/accounts/reservationListV2.ts | 190 ++++++++++++++++++ .../generated/accounts/tokenOwnedEscrow.ts | 2 +- .../js/src/generated/accounts/tokenRecord.ts | 4 +- .../generated/accounts/useAuthorityRecord.ts | 4 +- clients/js/src/generated/errors/index.ts | 2 +- .../{mplTokenMetadata.ts => tokenMetadata.ts} | 4 +- .../approveCollectionAuthority.ts | 2 +- .../instructions/approveUseAuthority.ts | 2 +- .../bubblegumSetCollectionSize.ts | 2 +- .../generated/instructions/burnEditionNft.ts | 2 +- .../js/src/generated/instructions/burnNft.ts | 2 +- .../js/src/generated/instructions/burnV1.ts | 2 +- .../instructions/closeEscrowAccount.ts | 2 +- .../js/src/generated/instructions/collect.ts | 2 +- .../convertMasterEditionV1ToV2.ts | 2 +- .../instructions/createEscrowAccount.ts | 2 +- .../instructions/createMasterEditionV3.ts | 2 +- .../instructions/createMetadataAccountV3.ts | 2 +- .../js/src/generated/instructions/createV1.ts | 2 +- .../instructions/delegateAuthorityItemV1.ts | 2 +- .../instructions/delegateCollectionItemV1.ts | 2 +- .../instructions/delegateCollectionV1.ts | 2 +- .../instructions/delegateDataItemV1.ts | 2 +- .../generated/instructions/delegateDataV1.ts | 2 +- .../instructions/delegateLockedTransferV1.ts | 2 +- .../delegateProgrammableConfigItemV1.ts | 2 +- .../delegateProgrammableConfigV1.ts | 2 +- .../generated/instructions/delegateSaleV1.ts | 2 +- .../instructions/delegateStakingV1.ts | 2 +- .../instructions/delegateStandardV1.ts | 2 +- .../instructions/delegateTransferV1.ts | 2 +- .../instructions/delegateUtilityV1.ts | 2 +- ...ditionFromMasterEditionViaPrintingToken.ts | 2 +- .../instructions/freezeDelegatedAccount.ts | 2 +- .../js/src/generated/instructions/lockV1.ts | 2 +- .../js/src/generated/instructions/migrate.ts | 2 +- ...mintNewEditionFromMasterEditionViaToken.ts | 2 +- ...ewEditionFromMasterEditionViaVaultProxy.ts | 2 +- .../js/src/generated/instructions/mintV1.ts | 2 +- .../js/src/generated/instructions/printV1.ts | 2 +- .../generated/instructions/puffMetadata.ts | 2 +- .../instructions/removeCreatorVerification.ts | 2 +- .../instructions/revokeAuthorityItemV1.ts | 2 +- .../instructions/revokeCollectionAuthority.ts | 2 +- .../instructions/revokeCollectionItemV1.ts | 2 +- .../instructions/revokeCollectionV1.ts | 2 +- .../instructions/revokeDataItemV1.ts | 2 +- .../generated/instructions/revokeDataV1.ts | 2 +- .../instructions/revokeLockedTransferV1.ts | 2 +- .../instructions/revokeMigrationV1.ts | 2 +- .../revokeProgrammableConfigItemV1.ts | 2 +- .../revokeProgrammableConfigV1.ts | 2 +- .../generated/instructions/revokeSaleV1.ts | 2 +- .../generated/instructions/revokeStakingV1.ts | 2 +- .../instructions/revokeStandardV1.ts | 2 +- .../instructions/revokeTransferV1.ts | 2 +- .../instructions/revokeUseAuthority.ts | 2 +- .../generated/instructions/revokeUtilityV1.ts | 2 +- .../instructions/setAndVerifyCollection.ts | 2 +- .../setAndVerifySizedCollectionItem.ts | 2 +- .../instructions/setCollectionSize.ts | 2 +- .../instructions/setTokenStandard.ts | 2 +- .../generated/instructions/signMetadata.ts | 2 +- .../instructions/thawDelegatedAccount.ts | 2 +- .../instructions/transferOutOfEscrow.ts | 2 +- .../src/generated/instructions/transferV1.ts | 2 +- .../js/src/generated/instructions/unlockV1.ts | 2 +- .../instructions/unverifyCollection.ts | 2 +- .../instructions/unverifyCollectionV1.ts | 2 +- .../instructions/unverifyCreatorV1.ts | 2 +- .../unverifySizedCollectionItem.ts | 2 +- .../updateAsAuthorityItemDelegateV2.ts | 2 +- .../updateAsCollectionDelegateV2.ts | 2 +- .../updateAsCollectionItemDelegateV2.ts | 2 +- .../instructions/updateAsDataDelegateV2.ts | 2 +- .../updateAsDataItemDelegateV2.ts | 2 +- .../updateAsProgrammableConfigDelegateV2.ts | 2 +- ...pdateAsProgrammableConfigItemDelegateV2.ts | 2 +- .../instructions/updateAsUpdateAuthorityV2.ts | 2 +- .../instructions/updateMetadataAccountV2.ts | 2 +- .../updatePrimarySaleHappenedViaToken.ts | 2 +- .../js/src/generated/instructions/updateV1.ts | 2 +- .../js/src/generated/instructions/useV1.ts | 2 +- .../js/src/generated/instructions/utilize.ts | 2 +- .../instructions/verifyCollection.ts | 2 +- .../instructions/verifyCollectionV1.ts | 2 +- .../generated/instructions/verifyCreatorV1.ts | 2 +- .../instructions/verifySizedCollectionItem.ts | 2 +- clients/js/src/generated/programs/index.ts | 2 +- .../{mplTokenMetadata.ts => tokenMetadata.ts} | 26 +-- .../accounts/collection_authority_record.rs | 8 +- .../src/generated/accounts/edition_marker.rs | 8 +- .../src/generated/accounts/master_edition.rs | 8 +- .../generated/accounts/master_edition_v1.rs | 31 +++ .../rust/src/generated/accounts/metadata.rs | 8 +- .../accounts/metadata_delegate_record.rs | 8 +- clients/rust/src/generated/accounts/mod.rs | 6 + .../generated/accounts/reservation_list_v1.rs | 31 +++ .../generated/accounts/reservation_list_v2.rs | 33 +++ .../src/generated/accounts/token_record.rs | 8 +- .../accounts/use_authority_record.rs | 8 +- clients/rust/src/generated/errors/mod.rs | 4 +- ...pl_token_metadata.rs => token_metadata.rs} | 4 +- .../approve_collection_authority.rs | 8 +- .../instructions/approve_use_authority.rs | 8 +- .../bubblegum_set_collection_size.rs | 8 +- .../instructions/burn_edition_nft.rs | 4 +- .../src/generated/instructions/burn_nft.rs | 8 +- .../src/generated/instructions/burn_v1.rs | 32 +-- .../instructions/close_escrow_account.rs | 4 +- .../src/generated/instructions/collect.rs | 4 +- .../convert_master_edition_v1_to_v2.rs | 4 +- .../instructions/create_escrow_account.rs | 8 +- .../instructions/create_master_edition_v3.rs | 8 +- .../create_metadata_account_v3.rs | 8 +- .../src/generated/instructions/create_v1.rs | 8 +- .../delegate_authority_item_v1.rs | 32 +-- .../delegate_collection_item_v1.rs | 32 +-- .../instructions/delegate_collection_v1.rs | 32 +-- .../instructions/delegate_data_item_v1.rs | 32 +-- .../instructions/delegate_data_v1.rs | 32 +-- .../delegate_locked_transfer_v1.rs | 28 +-- .../delegate_programmable_config_item_v1.rs | 32 +-- .../delegate_programmable_config_v1.rs | 32 +-- .../instructions/delegate_sale_v1.rs | 28 +-- .../instructions/delegate_staking_v1.rs | 28 +-- .../instructions/delegate_standard_v1.rs | 28 +-- .../instructions/delegate_transfer_v1.rs | 28 +-- .../instructions/delegate_utility_v1.rs | 28 +-- ..._from_master_edition_via_printing_token.rs | 8 +- .../instructions/freeze_delegated_account.rs | 4 +- .../src/generated/instructions/lock_v1.rs | 28 +-- .../src/generated/instructions/migrate.rs | 12 +- ...w_edition_from_master_edition_via_token.rs | 8 +- ...ion_from_master_edition_via_vault_proxy.rs | 8 +- .../src/generated/instructions/mint_v1.rs | 28 +-- .../src/generated/instructions/print_v1.rs | 8 +- .../generated/instructions/puff_metadata.rs | 4 +- .../remove_creator_verification.rs | 4 +- .../instructions/revoke_authority_item_v1.rs | 32 +-- .../revoke_collection_authority.rs | 4 +- .../instructions/revoke_collection_item_v1.rs | 32 +-- .../instructions/revoke_collection_v1.rs | 32 +-- .../instructions/revoke_data_item_v1.rs | 32 +-- .../generated/instructions/revoke_data_v1.rs | 32 +-- .../instructions/revoke_locked_transfer_v1.rs | 28 +-- .../instructions/revoke_migration_v1.rs | 28 +-- .../revoke_programmable_config_item_v1.rs | 32 +-- .../revoke_programmable_config_v1.rs | 32 +-- .../generated/instructions/revoke_sale_v1.rs | 28 +-- .../instructions/revoke_staking_v1.rs | 28 +-- .../instructions/revoke_standard_v1.rs | 28 +-- .../instructions/revoke_transfer_v1.rs | 28 +-- .../instructions/revoke_use_authority.rs | 8 +- .../instructions/revoke_utility_v1.rs | 28 +-- .../instructions/set_and_verify_collection.rs | 8 +- .../set_and_verify_sized_collection_item.rs | 8 +- .../instructions/set_collection_size.rs | 8 +- .../instructions/set_token_standard.rs | 8 +- .../generated/instructions/sign_metadata.rs | 4 +- .../instructions/thaw_delegated_account.rs | 4 +- .../instructions/transfer_out_of_escrow.rs | 8 +- .../src/generated/instructions/transfer_v1.rs | 24 +-- .../src/generated/instructions/unlock_v1.rs | 28 +-- .../instructions/unverify_collection.rs | 8 +- .../instructions/unverify_collection_v1.rs | 12 +- .../instructions/unverify_creator_v1.rs | 16 +- .../unverify_sized_collection_item.rs | 8 +- .../update_as_authority_item_delegate_v2.rs | 24 +-- .../update_as_collection_delegate_v2.rs | 24 +-- .../update_as_collection_item_delegate_v2.rs | 24 +-- .../update_as_data_delegate_v2.rs | 24 +-- .../update_as_data_item_delegate_v2.rs | 24 +-- ...date_as_programmable_config_delegate_v2.rs | 20 +- ...as_programmable_config_item_delegate_v2.rs | 20 +- .../update_as_update_authority_v2.rs | 24 +-- .../update_metadata_account_v2.rs | 4 +- .../update_primary_sale_happened_via_token.rs | 4 +- .../src/generated/instructions/update_v1.rs | 24 +-- .../rust/src/generated/instructions/use_v1.rs | 28 +-- .../src/generated/instructions/utilize.rs | 12 +- .../instructions/verify_collection.rs | 8 +- .../instructions/verify_collection_v1.rs | 16 +- .../instructions/verify_creator_v1.rs | 20 +- .../verify_sized_collection_item.rs | 8 +- clients/rust/src/generated/programs.rs | 4 +- 196 files changed, 1546 insertions(+), 900 deletions(-) create mode 100644 clients/js/src/generated/accounts/masterEditionV1.ts create mode 100644 clients/js/src/generated/accounts/reservationListV1.ts create mode 100644 clients/js/src/generated/accounts/reservationListV2.ts rename clients/js/src/generated/errors/{mplTokenMetadata.ts => tokenMetadata.ts} (99%) rename clients/js/src/generated/programs/{mplTokenMetadata.ts => tokenMetadata.ts} (58%) create mode 100644 clients/rust/src/generated/accounts/master_edition_v1.rs create mode 100644 clients/rust/src/generated/accounts/reservation_list_v1.rs create mode 100644 clients/rust/src/generated/accounts/reservation_list_v2.rs rename clients/rust/src/generated/errors/{mpl_token_metadata.rs => token_metadata.rs} (99%) diff --git a/clients/js/src/generated/accounts/collectionAuthorityRecord.ts b/clients/js/src/generated/accounts/collectionAuthorityRecord.ts index 2705c8b2..f74f90bc 100644 --- a/clients/js/src/generated/accounts/collectionAuthorityRecord.ts +++ b/clients/js/src/generated/accounts/collectionAuthorityRecord.ts @@ -163,7 +163,7 @@ export function getCollectionAuthorityRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -192,7 +192,7 @@ export function findCollectionAuthorityRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/edition.ts b/clients/js/src/generated/accounts/edition.ts index fcfb9e44..173a30e1 100644 --- a/clients/js/src/generated/accounts/edition.ts +++ b/clients/js/src/generated/accounts/edition.ts @@ -139,7 +139,7 @@ export function getEditionGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/editionMarker.ts b/clients/js/src/generated/accounts/editionMarker.ts index c25f3fd8..db3e92d6 100644 --- a/clients/js/src/generated/accounts/editionMarker.ts +++ b/clients/js/src/generated/accounts/editionMarker.ts @@ -139,7 +139,7 @@ export function getEditionMarkerGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -167,7 +167,7 @@ export function findEditionMarkerPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/editionMarkerV2.ts b/clients/js/src/generated/accounts/editionMarkerV2.ts index ea07c2b6..848016df 100644 --- a/clients/js/src/generated/accounts/editionMarkerV2.ts +++ b/clients/js/src/generated/accounts/editionMarkerV2.ts @@ -134,7 +134,7 @@ export function getEditionMarkerV2GpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/index.ts b/clients/js/src/generated/accounts/index.ts index 87dff227..b09ea82f 100644 --- a/clients/js/src/generated/accounts/index.ts +++ b/clients/js/src/generated/accounts/index.ts @@ -11,8 +11,11 @@ export * from './edition'; export * from './editionMarker'; export * from './editionMarkerV2'; export * from './masterEdition'; +export * from './masterEditionV1'; export * from './metadata'; export * from './metadataDelegateRecord'; +export * from './reservationListV1'; +export * from './reservationListV2'; export * from './tokenOwnedEscrow'; export * from './tokenRecord'; export * from './useAuthorityRecord'; diff --git a/clients/js/src/generated/accounts/masterEdition.ts b/clients/js/src/generated/accounts/masterEdition.ts index 35ae997d..3079bed0 100644 --- a/clients/js/src/generated/accounts/masterEdition.ts +++ b/clients/js/src/generated/accounts/masterEdition.ts @@ -149,7 +149,7 @@ export function getMasterEditionGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -180,7 +180,7 @@ export function findMasterEditionPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/masterEditionV1.ts b/clients/js/src/generated/accounts/masterEditionV1.ts new file mode 100644 index 00000000..dcdb6495 --- /dev/null +++ b/clients/js/src/generated/accounts/masterEditionV1.ts @@ -0,0 +1,172 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/metaplex-foundation/kinobi + */ + +import { + Account, + Context, + Option, + OptionOrNullable, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; +import { + Serializer, + option, + publicKey as publicKeySerializer, + struct, + u64, +} from '@metaplex-foundation/umi/serializers'; +import { Key, KeyArgs, getKeySerializer } from '../types'; + +export type MasterEditionV1 = Account; + +export type MasterEditionV1AccountData = { + key: Key; + supply: bigint; + maxSupply: Option; + printingMint: PublicKey; + oneTimePrintingAuthorizationMint: PublicKey; +}; + +export type MasterEditionV1AccountDataArgs = { + key: KeyArgs; + supply: number | bigint; + maxSupply: OptionOrNullable; + printingMint: PublicKey; + oneTimePrintingAuthorizationMint: PublicKey; +}; + +/** @deprecated Use `getMasterEditionV1AccountDataSerializer()` without any argument instead. */ +export function getMasterEditionV1AccountDataSerializer( + _context: object +): Serializer; +export function getMasterEditionV1AccountDataSerializer(): Serializer< + MasterEditionV1AccountDataArgs, + MasterEditionV1AccountData +>; +export function getMasterEditionV1AccountDataSerializer( + _context: object = {} +): Serializer { + return struct( + [ + ['key', getKeySerializer()], + ['supply', u64()], + ['maxSupply', option(u64())], + ['printingMint', publicKeySerializer()], + ['oneTimePrintingAuthorizationMint', publicKeySerializer()], + ], + { description: 'MasterEditionV1AccountData' } + ) as Serializer; +} + +/** @deprecated Use `deserializeMasterEditionV1(rawAccount)` without any context instead. */ +export function deserializeMasterEditionV1( + context: object, + rawAccount: RpcAccount +): MasterEditionV1; +export function deserializeMasterEditionV1( + rawAccount: RpcAccount +): MasterEditionV1; +export function deserializeMasterEditionV1( + context: RpcAccount | object, + rawAccount?: RpcAccount +): MasterEditionV1 { + return deserializeAccount( + rawAccount ?? (context as RpcAccount), + getMasterEditionV1AccountDataSerializer() + ); +} + +export async function fetchMasterEditionV1( + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions +): Promise { + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'MasterEditionV1'); + return deserializeMasterEditionV1(maybeAccount); +} + +export async function safeFetchMasterEditionV1( + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions +): Promise { + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists ? deserializeMasterEditionV1(maybeAccount) : null; +} + +export async function fetchAllMasterEditionV1( + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions +): Promise { + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'MasterEditionV1'); + return deserializeMasterEditionV1(maybeAccount); + }); +} + +export async function safeFetchAllMasterEditionV1( + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions +): Promise { + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => + deserializeMasterEditionV1(maybeAccount as RpcAccount) + ); +} + +export function getMasterEditionV1GpaBuilder( + context: Pick +) { + const programId = context.programs.getPublicKey( + 'tokenMetadata', + 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' + ); + return gpaBuilder(context, programId) + .registerFields<{ + key: KeyArgs; + supply: number | bigint; + maxSupply: OptionOrNullable; + printingMint: PublicKey; + oneTimePrintingAuthorizationMint: PublicKey; + }>({ + key: [0, getKeySerializer()], + supply: [1, u64()], + maxSupply: [9, option(u64())], + printingMint: [null, publicKeySerializer()], + oneTimePrintingAuthorizationMint: [null, publicKeySerializer()], + }) + .deserializeUsing((account) => + deserializeMasterEditionV1(account) + ); +} diff --git a/clients/js/src/generated/accounts/metadata.ts b/clients/js/src/generated/accounts/metadata.ts index 57719a6f..e79cd110 100644 --- a/clients/js/src/generated/accounts/metadata.ts +++ b/clients/js/src/generated/accounts/metadata.ts @@ -207,7 +207,7 @@ export function getMetadataGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -262,7 +262,7 @@ export function findMetadataPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/metadataDelegateRecord.ts b/clients/js/src/generated/accounts/metadataDelegateRecord.ts index c4553253..41707439 100644 --- a/clients/js/src/generated/accounts/metadataDelegateRecord.ts +++ b/clients/js/src/generated/accounts/metadataDelegateRecord.ts @@ -162,7 +162,7 @@ export function getMetadataDelegateRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -202,7 +202,7 @@ export function findMetadataDelegateRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/reservationListV1.ts b/clients/js/src/generated/accounts/reservationListV1.ts new file mode 100644 index 00000000..31981255 --- /dev/null +++ b/clients/js/src/generated/accounts/reservationListV1.ts @@ -0,0 +1,180 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/metaplex-foundation/kinobi + */ + +import { + Account, + Context, + Option, + OptionOrNullable, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; +import { + Serializer, + array, + option, + publicKey as publicKeySerializer, + struct, + u64, +} from '@metaplex-foundation/umi/serializers'; +import { + Key, + KeyArgs, + ReservationV1, + ReservationV1Args, + getKeySerializer, + getReservationV1Serializer, +} from '../types'; + +export type ReservationListV1 = Account; + +export type ReservationListV1AccountData = { + key: Key; + masterEdition: PublicKey; + supplySnapshot: Option; + reservations: Array; +}; + +export type ReservationListV1AccountDataArgs = { + key: KeyArgs; + masterEdition: PublicKey; + supplySnapshot: OptionOrNullable; + reservations: Array; +}; + +/** @deprecated Use `getReservationListV1AccountDataSerializer()` without any argument instead. */ +export function getReservationListV1AccountDataSerializer( + _context: object +): Serializer; +export function getReservationListV1AccountDataSerializer(): Serializer< + ReservationListV1AccountDataArgs, + ReservationListV1AccountData +>; +export function getReservationListV1AccountDataSerializer( + _context: object = {} +): Serializer { + return struct( + [ + ['key', getKeySerializer()], + ['masterEdition', publicKeySerializer()], + ['supplySnapshot', option(u64())], + ['reservations', array(getReservationV1Serializer())], + ], + { description: 'ReservationListV1AccountData' } + ) as Serializer< + ReservationListV1AccountDataArgs, + ReservationListV1AccountData + >; +} + +/** @deprecated Use `deserializeReservationListV1(rawAccount)` without any context instead. */ +export function deserializeReservationListV1( + context: object, + rawAccount: RpcAccount +): ReservationListV1; +export function deserializeReservationListV1( + rawAccount: RpcAccount +): ReservationListV1; +export function deserializeReservationListV1( + context: RpcAccount | object, + rawAccount?: RpcAccount +): ReservationListV1 { + return deserializeAccount( + rawAccount ?? (context as RpcAccount), + getReservationListV1AccountDataSerializer() + ); +} + +export async function fetchReservationListV1( + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions +): Promise { + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'ReservationListV1'); + return deserializeReservationListV1(maybeAccount); +} + +export async function safeFetchReservationListV1( + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions +): Promise { + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists + ? deserializeReservationListV1(maybeAccount) + : null; +} + +export async function fetchAllReservationListV1( + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions +): Promise { + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'ReservationListV1'); + return deserializeReservationListV1(maybeAccount); + }); +} + +export async function safeFetchAllReservationListV1( + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions +): Promise { + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => + deserializeReservationListV1(maybeAccount as RpcAccount) + ); +} + +export function getReservationListV1GpaBuilder( + context: Pick +) { + const programId = context.programs.getPublicKey( + 'tokenMetadata', + 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' + ); + return gpaBuilder(context, programId) + .registerFields<{ + key: KeyArgs; + masterEdition: PublicKey; + supplySnapshot: OptionOrNullable; + reservations: Array; + }>({ + key: [0, getKeySerializer()], + masterEdition: [1, publicKeySerializer()], + supplySnapshot: [33, option(u64())], + reservations: [null, array(getReservationV1Serializer())], + }) + .deserializeUsing((account) => + deserializeReservationListV1(account) + ); +} diff --git a/clients/js/src/generated/accounts/reservationListV2.ts b/clients/js/src/generated/accounts/reservationListV2.ts new file mode 100644 index 00000000..74cdc3a1 --- /dev/null +++ b/clients/js/src/generated/accounts/reservationListV2.ts @@ -0,0 +1,190 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/metaplex-foundation/kinobi + */ + +import { + Account, + Context, + Option, + OptionOrNullable, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; +import { + Serializer, + array, + option, + publicKey as publicKeySerializer, + struct, + u64, +} from '@metaplex-foundation/umi/serializers'; +import { + Key, + KeyArgs, + Reservation, + ReservationArgs, + getKeySerializer, + getReservationSerializer, +} from '../types'; + +export type ReservationListV2 = Account; + +export type ReservationListV2AccountData = { + key: Key; + masterEdition: PublicKey; + supplySnapshot: Option; + reservations: Array; + totalReservationSpots: bigint; + currentReservationSpots: bigint; +}; + +export type ReservationListV2AccountDataArgs = { + key: KeyArgs; + masterEdition: PublicKey; + supplySnapshot: OptionOrNullable; + reservations: Array; + totalReservationSpots: number | bigint; + currentReservationSpots: number | bigint; +}; + +/** @deprecated Use `getReservationListV2AccountDataSerializer()` without any argument instead. */ +export function getReservationListV2AccountDataSerializer( + _context: object +): Serializer; +export function getReservationListV2AccountDataSerializer(): Serializer< + ReservationListV2AccountDataArgs, + ReservationListV2AccountData +>; +export function getReservationListV2AccountDataSerializer( + _context: object = {} +): Serializer { + return struct( + [ + ['key', getKeySerializer()], + ['masterEdition', publicKeySerializer()], + ['supplySnapshot', option(u64())], + ['reservations', array(getReservationSerializer())], + ['totalReservationSpots', u64()], + ['currentReservationSpots', u64()], + ], + { description: 'ReservationListV2AccountData' } + ) as Serializer< + ReservationListV2AccountDataArgs, + ReservationListV2AccountData + >; +} + +/** @deprecated Use `deserializeReservationListV2(rawAccount)` without any context instead. */ +export function deserializeReservationListV2( + context: object, + rawAccount: RpcAccount +): ReservationListV2; +export function deserializeReservationListV2( + rawAccount: RpcAccount +): ReservationListV2; +export function deserializeReservationListV2( + context: RpcAccount | object, + rawAccount?: RpcAccount +): ReservationListV2 { + return deserializeAccount( + rawAccount ?? (context as RpcAccount), + getReservationListV2AccountDataSerializer() + ); +} + +export async function fetchReservationListV2( + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions +): Promise { + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'ReservationListV2'); + return deserializeReservationListV2(maybeAccount); +} + +export async function safeFetchReservationListV2( + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions +): Promise { + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists + ? deserializeReservationListV2(maybeAccount) + : null; +} + +export async function fetchAllReservationListV2( + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions +): Promise { + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'ReservationListV2'); + return deserializeReservationListV2(maybeAccount); + }); +} + +export async function safeFetchAllReservationListV2( + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions +): Promise { + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => + deserializeReservationListV2(maybeAccount as RpcAccount) + ); +} + +export function getReservationListV2GpaBuilder( + context: Pick +) { + const programId = context.programs.getPublicKey( + 'tokenMetadata', + 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' + ); + return gpaBuilder(context, programId) + .registerFields<{ + key: KeyArgs; + masterEdition: PublicKey; + supplySnapshot: OptionOrNullable; + reservations: Array; + totalReservationSpots: number | bigint; + currentReservationSpots: number | bigint; + }>({ + key: [0, getKeySerializer()], + masterEdition: [1, publicKeySerializer()], + supplySnapshot: [33, option(u64())], + reservations: [null, array(getReservationSerializer())], + totalReservationSpots: [null, u64()], + currentReservationSpots: [null, u64()], + }) + .deserializeUsing((account) => + deserializeReservationListV2(account) + ); +} diff --git a/clients/js/src/generated/accounts/tokenOwnedEscrow.ts b/clients/js/src/generated/accounts/tokenOwnedEscrow.ts index eef9f00f..95791f4e 100644 --- a/clients/js/src/generated/accounts/tokenOwnedEscrow.ts +++ b/clients/js/src/generated/accounts/tokenOwnedEscrow.ts @@ -157,7 +157,7 @@ export function getTokenOwnedEscrowGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/tokenRecord.ts b/clients/js/src/generated/accounts/tokenRecord.ts index 294405f8..f9a641e9 100644 --- a/clients/js/src/generated/accounts/tokenRecord.ts +++ b/clients/js/src/generated/accounts/tokenRecord.ts @@ -166,7 +166,7 @@ export function getTokenRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -205,7 +205,7 @@ export function findTokenRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/useAuthorityRecord.ts b/clients/js/src/generated/accounts/useAuthorityRecord.ts index 0814edb3..7a3fb4ab 100644 --- a/clients/js/src/generated/accounts/useAuthorityRecord.ts +++ b/clients/js/src/generated/accounts/useAuthorityRecord.ts @@ -157,7 +157,7 @@ export function getUseAuthorityRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -190,7 +190,7 @@ export function findUseAuthorityRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/errors/index.ts b/clients/js/src/generated/errors/index.ts index 40440497..cbfa4bd8 100644 --- a/clients/js/src/generated/errors/index.ts +++ b/clients/js/src/generated/errors/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './mplTokenMetadata'; +export * from './tokenMetadata'; diff --git a/clients/js/src/generated/errors/mplTokenMetadata.ts b/clients/js/src/generated/errors/tokenMetadata.ts similarity index 99% rename from clients/js/src/generated/errors/mplTokenMetadata.ts rename to clients/js/src/generated/errors/tokenMetadata.ts index ed040264..15b36ac2 100644 --- a/clients/js/src/generated/errors/mplTokenMetadata.ts +++ b/clients/js/src/generated/errors/tokenMetadata.ts @@ -2841,7 +2841,7 @@ nameToErrorMap.set('InvalidMetadataFlags', InvalidMetadataFlagsError); * Attempts to resolve a custom program error from the provided error code. * @category Errors */ -export function getMplTokenMetadataErrorFromCode( +export function getTokenMetadataErrorFromCode( code: number, program: Program, cause?: Error @@ -2854,7 +2854,7 @@ export function getMplTokenMetadataErrorFromCode( * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors */ -export function getMplTokenMetadataErrorFromName( +export function getTokenMetadataErrorFromName( name: string, program: Program, cause?: Error diff --git a/clients/js/src/generated/instructions/approveCollectionAuthority.ts b/clients/js/src/generated/instructions/approveCollectionAuthority.ts index f3c5d5d4..a47c1329 100644 --- a/clients/js/src/generated/instructions/approveCollectionAuthority.ts +++ b/clients/js/src/generated/instructions/approveCollectionAuthority.ts @@ -95,7 +95,7 @@ export function approveCollectionAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/approveUseAuthority.ts b/clients/js/src/generated/instructions/approveUseAuthority.ts index 86befd50..34b6713c 100644 --- a/clients/js/src/generated/instructions/approveUseAuthority.ts +++ b/clients/js/src/generated/instructions/approveUseAuthority.ts @@ -113,7 +113,7 @@ export function approveUseAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts index 07cbc52e..99dcdcf3 100644 --- a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts +++ b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts @@ -103,7 +103,7 @@ export function bubblegumSetCollectionSize( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/burnEditionNft.ts b/clients/js/src/generated/instructions/burnEditionNft.ts index 46581d61..9d2195e5 100644 --- a/clients/js/src/generated/instructions/burnEditionNft.ts +++ b/clients/js/src/generated/instructions/burnEditionNft.ts @@ -91,7 +91,7 @@ export function burnEditionNft( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/burnNft.ts b/clients/js/src/generated/instructions/burnNft.ts index de731796..303150bd 100644 --- a/clients/js/src/generated/instructions/burnNft.ts +++ b/clients/js/src/generated/instructions/burnNft.ts @@ -77,7 +77,7 @@ export function burnNft( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/burnV1.ts b/clients/js/src/generated/instructions/burnV1.ts index c1560fb1..7ef31404 100644 --- a/clients/js/src/generated/instructions/burnV1.ts +++ b/clients/js/src/generated/instructions/burnV1.ts @@ -125,7 +125,7 @@ export function burnV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/closeEscrowAccount.ts b/clients/js/src/generated/instructions/closeEscrowAccount.ts index b9b9d523..451c0ab1 100644 --- a/clients/js/src/generated/instructions/closeEscrowAccount.ts +++ b/clients/js/src/generated/instructions/closeEscrowAccount.ts @@ -92,7 +92,7 @@ export function closeEscrowAccount( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/collect.ts b/clients/js/src/generated/instructions/collect.ts index a1b1c87d..7c916325 100644 --- a/clients/js/src/generated/instructions/collect.ts +++ b/clients/js/src/generated/instructions/collect.ts @@ -65,7 +65,7 @@ export function collect( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts b/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts index 13d11640..b319e1ea 100644 --- a/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts +++ b/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts @@ -83,7 +83,7 @@ export function convertMasterEditionV1ToV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createEscrowAccount.ts b/clients/js/src/generated/instructions/createEscrowAccount.ts index c5246aa5..b196db29 100644 --- a/clients/js/src/generated/instructions/createEscrowAccount.ts +++ b/clients/js/src/generated/instructions/createEscrowAccount.ts @@ -94,7 +94,7 @@ export function createEscrowAccount( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createMasterEditionV3.ts b/clients/js/src/generated/instructions/createMasterEditionV3.ts index 154023ea..acb56add 100644 --- a/clients/js/src/generated/instructions/createMasterEditionV3.ts +++ b/clients/js/src/generated/instructions/createMasterEditionV3.ts @@ -112,7 +112,7 @@ export function createMasterEditionV3( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createMetadataAccountV3.ts b/clients/js/src/generated/instructions/createMetadataAccountV3.ts index 8f4e2198..9cc67169 100644 --- a/clients/js/src/generated/instructions/createMetadataAccountV3.ts +++ b/clients/js/src/generated/instructions/createMetadataAccountV3.ts @@ -122,7 +122,7 @@ export function createMetadataAccountV3( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createV1.ts b/clients/js/src/generated/instructions/createV1.ts index 40368f7f..c2b64470 100644 --- a/clients/js/src/generated/instructions/createV1.ts +++ b/clients/js/src/generated/instructions/createV1.ts @@ -201,7 +201,7 @@ export function createV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts b/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts index 132bfa70..41670d90 100644 --- a/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts +++ b/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts @@ -150,7 +150,7 @@ export function delegateAuthorityItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateCollectionItemV1.ts b/clients/js/src/generated/instructions/delegateCollectionItemV1.ts index fceb304d..769829e6 100644 --- a/clients/js/src/generated/instructions/delegateCollectionItemV1.ts +++ b/clients/js/src/generated/instructions/delegateCollectionItemV1.ts @@ -150,7 +150,7 @@ export function delegateCollectionItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateCollectionV1.ts b/clients/js/src/generated/instructions/delegateCollectionV1.ts index 35de1072..7b986a52 100644 --- a/clients/js/src/generated/instructions/delegateCollectionV1.ts +++ b/clients/js/src/generated/instructions/delegateCollectionV1.ts @@ -150,7 +150,7 @@ export function delegateCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateDataItemV1.ts b/clients/js/src/generated/instructions/delegateDataItemV1.ts index f455e3a4..bcab90cf 100644 --- a/clients/js/src/generated/instructions/delegateDataItemV1.ts +++ b/clients/js/src/generated/instructions/delegateDataItemV1.ts @@ -150,7 +150,7 @@ export function delegateDataItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateDataV1.ts b/clients/js/src/generated/instructions/delegateDataV1.ts index eaa04cac..6c95930d 100644 --- a/clients/js/src/generated/instructions/delegateDataV1.ts +++ b/clients/js/src/generated/instructions/delegateDataV1.ts @@ -145,7 +145,7 @@ export function delegateDataV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateLockedTransferV1.ts b/clients/js/src/generated/instructions/delegateLockedTransferV1.ts index 1d4b7231..4e5b6680 100644 --- a/clients/js/src/generated/instructions/delegateLockedTransferV1.ts +++ b/clients/js/src/generated/instructions/delegateLockedTransferV1.ts @@ -159,7 +159,7 @@ export function delegateLockedTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts b/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts index 3e18d614..a54bf67a 100644 --- a/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts +++ b/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts @@ -150,7 +150,7 @@ export function delegateProgrammableConfigItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts b/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts index 1d99f695..d664f377 100644 --- a/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts +++ b/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts @@ -150,7 +150,7 @@ export function delegateProgrammableConfigV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateSaleV1.ts b/clients/js/src/generated/instructions/delegateSaleV1.ts index 794989b2..4984f978 100644 --- a/clients/js/src/generated/instructions/delegateSaleV1.ts +++ b/clients/js/src/generated/instructions/delegateSaleV1.ts @@ -150,7 +150,7 @@ export function delegateSaleV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateStakingV1.ts b/clients/js/src/generated/instructions/delegateStakingV1.ts index 37ae3dcc..6030bd1b 100644 --- a/clients/js/src/generated/instructions/delegateStakingV1.ts +++ b/clients/js/src/generated/instructions/delegateStakingV1.ts @@ -153,7 +153,7 @@ export function delegateStakingV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateStandardV1.ts b/clients/js/src/generated/instructions/delegateStandardV1.ts index f219f569..e2403c64 100644 --- a/clients/js/src/generated/instructions/delegateStandardV1.ts +++ b/clients/js/src/generated/instructions/delegateStandardV1.ts @@ -141,7 +141,7 @@ export function delegateStandardV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateTransferV1.ts b/clients/js/src/generated/instructions/delegateTransferV1.ts index 04ead297..b80f7f23 100644 --- a/clients/js/src/generated/instructions/delegateTransferV1.ts +++ b/clients/js/src/generated/instructions/delegateTransferV1.ts @@ -155,7 +155,7 @@ export function delegateTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateUtilityV1.ts b/clients/js/src/generated/instructions/delegateUtilityV1.ts index c79c537d..7e964ac0 100644 --- a/clients/js/src/generated/instructions/delegateUtilityV1.ts +++ b/clients/js/src/generated/instructions/delegateUtilityV1.ts @@ -153,7 +153,7 @@ export function delegateUtilityV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts index 3204d5af..7d74e694 100644 --- a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts +++ b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts @@ -115,7 +115,7 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/freezeDelegatedAccount.ts b/clients/js/src/generated/instructions/freezeDelegatedAccount.ts index 602e08b0..d9bae93f 100644 --- a/clients/js/src/generated/instructions/freezeDelegatedAccount.ts +++ b/clients/js/src/generated/instructions/freezeDelegatedAccount.ts @@ -86,7 +86,7 @@ export function freezeDelegatedAccount( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/lockV1.ts b/clients/js/src/generated/instructions/lockV1.ts index ed56b2ae..ecd7b32d 100644 --- a/clients/js/src/generated/instructions/lockV1.ts +++ b/clients/js/src/generated/instructions/lockV1.ts @@ -130,7 +130,7 @@ export function lockV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/migrate.ts b/clients/js/src/generated/instructions/migrate.ts index a642819a..5b07a8d1 100644 --- a/clients/js/src/generated/instructions/migrate.ts +++ b/clients/js/src/generated/instructions/migrate.ts @@ -98,7 +98,7 @@ export function migrate( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts index 1f1cf719..933168b3 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts @@ -124,7 +124,7 @@ export function mintNewEditionFromMasterEditionViaToken( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts index 37ddf9b4..6a8b73f9 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts @@ -133,7 +133,7 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/mintV1.ts b/clients/js/src/generated/instructions/mintV1.ts index 6f7083d5..cd4ccf0c 100644 --- a/clients/js/src/generated/instructions/mintV1.ts +++ b/clients/js/src/generated/instructions/mintV1.ts @@ -138,7 +138,7 @@ export function mintV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/printV1.ts b/clients/js/src/generated/instructions/printV1.ts index 873cff40..9220c478 100644 --- a/clients/js/src/generated/instructions/printV1.ts +++ b/clients/js/src/generated/instructions/printV1.ts @@ -112,7 +112,7 @@ export function printV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/puffMetadata.ts b/clients/js/src/generated/instructions/puffMetadata.ts index 1a67127e..e026d8c9 100644 --- a/clients/js/src/generated/instructions/puffMetadata.ts +++ b/clients/js/src/generated/instructions/puffMetadata.ts @@ -67,7 +67,7 @@ export function puffMetadata( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/removeCreatorVerification.ts b/clients/js/src/generated/instructions/removeCreatorVerification.ts index b02872ea..4db12289 100644 --- a/clients/js/src/generated/instructions/removeCreatorVerification.ts +++ b/clients/js/src/generated/instructions/removeCreatorVerification.ts @@ -81,7 +81,7 @@ export function removeCreatorVerification( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts b/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts index e17ef813..3624df82 100644 --- a/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts +++ b/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts @@ -134,7 +134,7 @@ export function revokeAuthorityItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeCollectionAuthority.ts b/clients/js/src/generated/instructions/revokeCollectionAuthority.ts index 0a3ce571..a4607429 100644 --- a/clients/js/src/generated/instructions/revokeCollectionAuthority.ts +++ b/clients/js/src/generated/instructions/revokeCollectionAuthority.ts @@ -89,7 +89,7 @@ export function revokeCollectionAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeCollectionItemV1.ts b/clients/js/src/generated/instructions/revokeCollectionItemV1.ts index 7f4008fd..50d06d71 100644 --- a/clients/js/src/generated/instructions/revokeCollectionItemV1.ts +++ b/clients/js/src/generated/instructions/revokeCollectionItemV1.ts @@ -134,7 +134,7 @@ export function revokeCollectionItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeCollectionV1.ts b/clients/js/src/generated/instructions/revokeCollectionV1.ts index 636d6f0b..916544f5 100644 --- a/clients/js/src/generated/instructions/revokeCollectionV1.ts +++ b/clients/js/src/generated/instructions/revokeCollectionV1.ts @@ -134,7 +134,7 @@ export function revokeCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeDataItemV1.ts b/clients/js/src/generated/instructions/revokeDataItemV1.ts index f7fc44f0..a7132d91 100644 --- a/clients/js/src/generated/instructions/revokeDataItemV1.ts +++ b/clients/js/src/generated/instructions/revokeDataItemV1.ts @@ -133,7 +133,7 @@ export function revokeDataItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeDataV1.ts b/clients/js/src/generated/instructions/revokeDataV1.ts index 37fef570..9fb5ff8c 100644 --- a/clients/js/src/generated/instructions/revokeDataV1.ts +++ b/clients/js/src/generated/instructions/revokeDataV1.ts @@ -120,7 +120,7 @@ export function revokeDataV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeLockedTransferV1.ts b/clients/js/src/generated/instructions/revokeLockedTransferV1.ts index 09d946c4..174951c8 100644 --- a/clients/js/src/generated/instructions/revokeLockedTransferV1.ts +++ b/clients/js/src/generated/instructions/revokeLockedTransferV1.ts @@ -135,7 +135,7 @@ export function revokeLockedTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeMigrationV1.ts b/clients/js/src/generated/instructions/revokeMigrationV1.ts index 37b0352c..cc118d27 100644 --- a/clients/js/src/generated/instructions/revokeMigrationV1.ts +++ b/clients/js/src/generated/instructions/revokeMigrationV1.ts @@ -134,7 +134,7 @@ export function revokeMigrationV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts b/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts index 9ca969a3..f275a73d 100644 --- a/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts +++ b/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts @@ -134,7 +134,7 @@ export function revokeProgrammableConfigItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts b/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts index 4f2e6554..d8b7325c 100644 --- a/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts +++ b/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts @@ -134,7 +134,7 @@ export function revokeProgrammableConfigV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeSaleV1.ts b/clients/js/src/generated/instructions/revokeSaleV1.ts index 46d00983..1926ee38 100644 --- a/clients/js/src/generated/instructions/revokeSaleV1.ts +++ b/clients/js/src/generated/instructions/revokeSaleV1.ts @@ -121,7 +121,7 @@ export function revokeSaleV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeStakingV1.ts b/clients/js/src/generated/instructions/revokeStakingV1.ts index d39bbc13..6ad4be04 100644 --- a/clients/js/src/generated/instructions/revokeStakingV1.ts +++ b/clients/js/src/generated/instructions/revokeStakingV1.ts @@ -134,7 +134,7 @@ export function revokeStakingV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeStandardV1.ts b/clients/js/src/generated/instructions/revokeStandardV1.ts index 2aa045cd..ed715d6e 100644 --- a/clients/js/src/generated/instructions/revokeStandardV1.ts +++ b/clients/js/src/generated/instructions/revokeStandardV1.ts @@ -133,7 +133,7 @@ export function revokeStandardV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeTransferV1.ts b/clients/js/src/generated/instructions/revokeTransferV1.ts index 8f5aeca6..43df14df 100644 --- a/clients/js/src/generated/instructions/revokeTransferV1.ts +++ b/clients/js/src/generated/instructions/revokeTransferV1.ts @@ -134,7 +134,7 @@ export function revokeTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeUseAuthority.ts b/clients/js/src/generated/instructions/revokeUseAuthority.ts index 01d44a8d..2df16755 100644 --- a/clients/js/src/generated/instructions/revokeUseAuthority.ts +++ b/clients/js/src/generated/instructions/revokeUseAuthority.ts @@ -94,7 +94,7 @@ export function revokeUseAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeUtilityV1.ts b/clients/js/src/generated/instructions/revokeUtilityV1.ts index 349f48ee..15511a26 100644 --- a/clients/js/src/generated/instructions/revokeUtilityV1.ts +++ b/clients/js/src/generated/instructions/revokeUtilityV1.ts @@ -134,7 +134,7 @@ export function revokeUtilityV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setAndVerifyCollection.ts b/clients/js/src/generated/instructions/setAndVerifyCollection.ts index c88c2cdc..2d54c2f3 100644 --- a/clients/js/src/generated/instructions/setAndVerifyCollection.ts +++ b/clients/js/src/generated/instructions/setAndVerifyCollection.ts @@ -90,7 +90,7 @@ export function setAndVerifyCollection( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts index 97e21082..817669ac 100644 --- a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts @@ -93,7 +93,7 @@ export function setAndVerifySizedCollectionItem( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setCollectionSize.ts b/clients/js/src/generated/instructions/setCollectionSize.ts index d14de9b7..bab31a61 100644 --- a/clients/js/src/generated/instructions/setCollectionSize.ts +++ b/clients/js/src/generated/instructions/setCollectionSize.ts @@ -100,7 +100,7 @@ export function setCollectionSize( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setTokenStandard.ts b/clients/js/src/generated/instructions/setTokenStandard.ts index cd5952dd..276d3620 100644 --- a/clients/js/src/generated/instructions/setTokenStandard.ts +++ b/clients/js/src/generated/instructions/setTokenStandard.ts @@ -84,7 +84,7 @@ export function setTokenStandard( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/signMetadata.ts b/clients/js/src/generated/instructions/signMetadata.ts index ffe28823..bee1dcc7 100644 --- a/clients/js/src/generated/instructions/signMetadata.ts +++ b/clients/js/src/generated/instructions/signMetadata.ts @@ -69,7 +69,7 @@ export function signMetadata( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/thawDelegatedAccount.ts b/clients/js/src/generated/instructions/thawDelegatedAccount.ts index a9244a05..074ccade 100644 --- a/clients/js/src/generated/instructions/thawDelegatedAccount.ts +++ b/clients/js/src/generated/instructions/thawDelegatedAccount.ts @@ -86,7 +86,7 @@ export function thawDelegatedAccount( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/transferOutOfEscrow.ts b/clients/js/src/generated/instructions/transferOutOfEscrow.ts index 81fe6817..146d7701 100644 --- a/clients/js/src/generated/instructions/transferOutOfEscrow.ts +++ b/clients/js/src/generated/instructions/transferOutOfEscrow.ts @@ -116,7 +116,7 @@ export function transferOutOfEscrow( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/transferV1.ts b/clients/js/src/generated/instructions/transferV1.ts index 79a8cdf3..5d7f2d68 100644 --- a/clients/js/src/generated/instructions/transferV1.ts +++ b/clients/js/src/generated/instructions/transferV1.ts @@ -148,7 +148,7 @@ export function transferV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unlockV1.ts b/clients/js/src/generated/instructions/unlockV1.ts index 9bcd13b2..4c570cfb 100644 --- a/clients/js/src/generated/instructions/unlockV1.ts +++ b/clients/js/src/generated/instructions/unlockV1.ts @@ -134,7 +134,7 @@ export function unlockV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifyCollection.ts b/clients/js/src/generated/instructions/unverifyCollection.ts index 64cff44e..b9623953 100644 --- a/clients/js/src/generated/instructions/unverifyCollection.ts +++ b/clients/js/src/generated/instructions/unverifyCollection.ts @@ -86,7 +86,7 @@ export function unverifyCollection( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifyCollectionV1.ts b/clients/js/src/generated/instructions/unverifyCollectionV1.ts index 4a7e4c98..005e4481 100644 --- a/clients/js/src/generated/instructions/unverifyCollectionV1.ts +++ b/clients/js/src/generated/instructions/unverifyCollectionV1.ts @@ -101,7 +101,7 @@ export function unverifyCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifyCreatorV1.ts b/clients/js/src/generated/instructions/unverifyCreatorV1.ts index 24bafd93..449eaa5e 100644 --- a/clients/js/src/generated/instructions/unverifyCreatorV1.ts +++ b/clients/js/src/generated/instructions/unverifyCreatorV1.ts @@ -100,7 +100,7 @@ export function unverifyCreatorV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts index 17501bb7..3456023c 100644 --- a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts @@ -91,7 +91,7 @@ export function unverifySizedCollectionItem( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts index c8da3be4..d8722d9c 100644 --- a/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts @@ -159,7 +159,7 @@ export function updateAsAuthorityItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts b/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts index c3ed0e57..4d86f67e 100644 --- a/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts @@ -147,7 +147,7 @@ export function updateAsCollectionDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts index 8445a34c..90c2dc4d 100644 --- a/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts @@ -146,7 +146,7 @@ export function updateAsCollectionItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts b/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts index 73d64dfa..0acae41c 100644 --- a/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts @@ -172,7 +172,7 @@ export function updateAsDataDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts index 7646199b..06d5a59d 100644 --- a/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts @@ -171,7 +171,7 @@ export function updateAsDataItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts b/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts index 564e1fb2..888feb9f 100644 --- a/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts @@ -147,7 +147,7 @@ export function updateAsProgrammableConfigDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts index 990eef4a..a2af483f 100644 --- a/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts @@ -147,7 +147,7 @@ export function updateAsProgrammableConfigItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts b/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts index c3688e82..685c2843 100644 --- a/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts +++ b/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts @@ -216,7 +216,7 @@ export function updateAsUpdateAuthorityV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateMetadataAccountV2.ts b/clients/js/src/generated/instructions/updateMetadataAccountV2.ts index fb7db8de..d6f019c0 100644 --- a/clients/js/src/generated/instructions/updateMetadataAccountV2.ts +++ b/clients/js/src/generated/instructions/updateMetadataAccountV2.ts @@ -115,7 +115,7 @@ export function updateMetadataAccountV2( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts b/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts index b5c74ed6..f7e96f95 100644 --- a/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts +++ b/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts @@ -83,7 +83,7 @@ export function updatePrimarySaleHappenedViaToken( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateV1.ts b/clients/js/src/generated/instructions/updateV1.ts index 8e066eb4..9be03008 100644 --- a/clients/js/src/generated/instructions/updateV1.ts +++ b/clients/js/src/generated/instructions/updateV1.ts @@ -198,7 +198,7 @@ export function updateV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/useV1.ts b/clients/js/src/generated/instructions/useV1.ts index be0bc2d4..7870f53c 100644 --- a/clients/js/src/generated/instructions/useV1.ts +++ b/clients/js/src/generated/instructions/useV1.ts @@ -116,7 +116,7 @@ export function useV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/utilize.ts b/clients/js/src/generated/instructions/utilize.ts index d860e579..27f059fd 100644 --- a/clients/js/src/generated/instructions/utilize.ts +++ b/clients/js/src/generated/instructions/utilize.ts @@ -96,7 +96,7 @@ export function utilize( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifyCollection.ts b/clients/js/src/generated/instructions/verifyCollection.ts index eb522b93..8a0d5a44 100644 --- a/clients/js/src/generated/instructions/verifyCollection.ts +++ b/clients/js/src/generated/instructions/verifyCollection.ts @@ -88,7 +88,7 @@ export function verifyCollection( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifyCollectionV1.ts b/clients/js/src/generated/instructions/verifyCollectionV1.ts index 08b04d23..a929fc88 100644 --- a/clients/js/src/generated/instructions/verifyCollectionV1.ts +++ b/clients/js/src/generated/instructions/verifyCollectionV1.ts @@ -103,7 +103,7 @@ export function verifyCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifyCreatorV1.ts b/clients/js/src/generated/instructions/verifyCreatorV1.ts index 3ad89d48..731f0bfb 100644 --- a/clients/js/src/generated/instructions/verifyCreatorV1.ts +++ b/clients/js/src/generated/instructions/verifyCreatorV1.ts @@ -102,7 +102,7 @@ export function verifyCreatorV1( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts index f1248441..85e1d4d8 100644 --- a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts @@ -91,7 +91,7 @@ export function verifySizedCollectionItem( // Program ID. const programId = context.programs.getPublicKey( - 'mplTokenMetadata', + 'tokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/programs/index.ts b/clients/js/src/generated/programs/index.ts index 40440497..cbfa4bd8 100644 --- a/clients/js/src/generated/programs/index.ts +++ b/clients/js/src/generated/programs/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './mplTokenMetadata'; +export * from './tokenMetadata'; diff --git a/clients/js/src/generated/programs/mplTokenMetadata.ts b/clients/js/src/generated/programs/tokenMetadata.ts similarity index 58% rename from clients/js/src/generated/programs/mplTokenMetadata.ts rename to clients/js/src/generated/programs/tokenMetadata.ts index c2335d5c..e68dedd6 100644 --- a/clients/js/src/generated/programs/mplTokenMetadata.ts +++ b/clients/js/src/generated/programs/tokenMetadata.ts @@ -13,22 +13,22 @@ import { PublicKey, } from '@metaplex-foundation/umi'; import { - getMplTokenMetadataErrorFromCode, - getMplTokenMetadataErrorFromName, + getTokenMetadataErrorFromCode, + getTokenMetadataErrorFromName, } from '../errors'; -export const MPL_TOKEN_METADATA_PROGRAM_ID = +export const TOKEN_METADATA_PROGRAM_ID = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' as PublicKey<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'>; -export function createMplTokenMetadataProgram(): Program { +export function createTokenMetadataProgram(): Program { return { - name: 'mplTokenMetadata', - publicKey: MPL_TOKEN_METADATA_PROGRAM_ID, + name: 'tokenMetadata', + publicKey: TOKEN_METADATA_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { - return getMplTokenMetadataErrorFromCode(code, this, cause); + return getTokenMetadataErrorFromCode(code, this, cause); }, getErrorFromName(name: string, cause?: Error) { - return getMplTokenMetadataErrorFromName(name, this, cause); + return getTokenMetadataErrorFromName(name, this, cause); }, isOnCluster() { return true; @@ -36,20 +36,20 @@ export function createMplTokenMetadataProgram(): Program { }; } -export function getMplTokenMetadataProgram( +export function getTokenMetadataProgram( context: Pick, clusterFilter?: ClusterFilter ): T { - return context.programs.get('mplTokenMetadata', clusterFilter); + return context.programs.get('tokenMetadata', clusterFilter); } -export function getMplTokenMetadataProgramId( +export function getTokenMetadataProgramId( context: Pick, clusterFilter?: ClusterFilter ): PublicKey { return context.programs.getPublicKey( - 'mplTokenMetadata', - MPL_TOKEN_METADATA_PROGRAM_ID, + 'tokenMetadata', + TOKEN_METADATA_PROGRAM_ID, clusterFilter ); } diff --git a/clients/rust/src/generated/accounts/collection_authority_record.rs b/clients/rust/src/generated/accounts/collection_authority_record.rs index 657840e8..786c82c7 100644 --- a/clients/rust/src/generated/accounts/collection_authority_record.rs +++ b/clients/rust/src/generated/accounts/collection_authority_record.rs @@ -25,12 +25,12 @@ impl CollectionAuthorityRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "collection_authority".as_bytes(), collection_authority.as_ref(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -41,13 +41,13 @@ impl CollectionAuthorityRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "collection_authority".as_bytes(), collection_authority.as_ref(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/edition_marker.rs b/clients/rust/src/generated/accounts/edition_marker.rs index 1f7f5b93..9a1aac7e 100644 --- a/clients/rust/src/generated/accounts/edition_marker.rs +++ b/clients/rust/src/generated/accounts/edition_marker.rs @@ -23,12 +23,12 @@ impl EditionMarker { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), edition_marker.to_string().as_ref(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -39,13 +39,13 @@ impl EditionMarker { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), edition_marker.to_string().as_ref(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/master_edition.rs b/clients/rust/src/generated/accounts/master_edition.rs index 6cc68b4d..f58194bb 100644 --- a/clients/rust/src/generated/accounts/master_edition.rs +++ b/clients/rust/src/generated/accounts/master_edition.rs @@ -24,11 +24,11 @@ impl MasterEdition { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -38,12 +38,12 @@ impl MasterEdition { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/master_edition_v1.rs b/clients/rust/src/generated/accounts/master_edition_v1.rs new file mode 100644 index 00000000..3abe958c --- /dev/null +++ b/clients/rust/src/generated/accounts/master_edition_v1.rs @@ -0,0 +1,31 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct MasterEditionV1 { + pub key: Key, + pub supply: u64, + pub max_supply: Option, + pub printing_mint: Pubkey, + pub one_time_printing_authorization_mint: Pubkey, +} + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for MasterEditionV1 { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/metadata.rs b/clients/rust/src/generated/accounts/metadata.rs index ce9ab4f7..b212551d 100644 --- a/clients/rust/src/generated/accounts/metadata.rs +++ b/clients/rust/src/generated/accounts/metadata.rs @@ -43,10 +43,10 @@ impl Metadata { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -56,11 +56,11 @@ impl Metadata { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs index 17c61b50..ae582f56 100644 --- a/clients/rust/src/generated/accounts/metadata_delegate_record.rs +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -32,13 +32,13 @@ impl MetadataDelegateRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), delegate_role.to_string().as_ref(), update_authority.as_ref(), delegate.as_ref(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -51,14 +51,14 @@ impl MetadataDelegateRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), delegate_role.to_string().as_ref(), update_authority.as_ref(), delegate.as_ref(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/mod.rs b/clients/rust/src/generated/accounts/mod.rs index a2fd9d0b..89b74598 100644 --- a/clients/rust/src/generated/accounts/mod.rs +++ b/clients/rust/src/generated/accounts/mod.rs @@ -10,8 +10,11 @@ mod edition; mod edition_marker; mod edition_marker_v2; mod master_edition; +mod master_edition_v1; mod metadata; mod metadata_delegate_record; +mod reservation_list_v1; +mod reservation_list_v2; mod token_owned_escrow; mod token_record; mod use_authority_record; @@ -21,8 +24,11 @@ pub use edition::*; pub use edition_marker::*; pub use edition_marker_v2::*; pub use master_edition::*; +pub use master_edition_v1::*; pub use metadata::*; pub use metadata_delegate_record::*; +pub use reservation_list_v1::*; +pub use reservation_list_v2::*; pub use token_owned_escrow::*; pub use token_record::*; pub use use_authority_record::*; diff --git a/clients/rust/src/generated/accounts/reservation_list_v1.rs b/clients/rust/src/generated/accounts/reservation_list_v1.rs new file mode 100644 index 00000000..71cb020d --- /dev/null +++ b/clients/rust/src/generated/accounts/reservation_list_v1.rs @@ -0,0 +1,31 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use crate::generated::types::ReservationV1; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct ReservationListV1 { + pub key: Key, + pub master_edition: Pubkey, + pub supply_snapshot: Option, + pub reservations: Vec, +} + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for ReservationListV1 { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/reservation_list_v2.rs b/clients/rust/src/generated/accounts/reservation_list_v2.rs new file mode 100644 index 00000000..2e767308 --- /dev/null +++ b/clients/rust/src/generated/accounts/reservation_list_v2.rs @@ -0,0 +1,33 @@ +//! This code was AUTOGENERATED using the kinobi library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun kinobi to update it. +//! +//! [https://github.com/metaplex-foundation/kinobi] +//! + +use crate::generated::types::Key; +use crate::generated::types::Reservation; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +pub struct ReservationListV2 { + pub key: Key, + pub master_edition: Pubkey, + pub supply_snapshot: Option, + pub reservations: Vec, + pub total_reservation_spots: u64, + pub current_reservation_spots: u64, +} + +impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for ReservationListV2 { + type Error = std::io::Error; + + fn try_from( + account_info: &'a solana_program::account_info::AccountInfo<'a>, + ) -> Result { + let mut data: &[u8] = &(*account_info.data).borrow(); + Self::deserialize(&mut data) + } +} diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs index 7840e082..d4e60543 100644 --- a/clients/rust/src/generated/accounts/token_record.rs +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -30,12 +30,12 @@ impl TokenRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "token_record".as_bytes(), token.as_ref(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -46,13 +46,13 @@ impl TokenRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "token_record".as_bytes(), token.as_ref(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/use_authority_record.rs b/clients/rust/src/generated/accounts/use_authority_record.rs index 2a514bce..003a2db6 100644 --- a/clients/rust/src/generated/accounts/use_authority_record.rs +++ b/clients/rust/src/generated/accounts/use_authority_record.rs @@ -24,12 +24,12 @@ impl UseAuthorityRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "user".as_bytes(), use_authority.as_ref(), ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -40,13 +40,13 @@ impl UseAuthorityRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::MPL_TOKEN_METADATA_ID.as_ref(), + crate::TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "user".as_bytes(), use_authority.as_ref(), &[bump], ], - &crate::MPL_TOKEN_METADATA_ID, + &crate::TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/errors/mod.rs b/clients/rust/src/generated/errors/mod.rs index b2dd94ed..8980b3c7 100644 --- a/clients/rust/src/generated/errors/mod.rs +++ b/clients/rust/src/generated/errors/mod.rs @@ -5,6 +5,6 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -mod mpl_token_metadata; +mod token_metadata; -pub use mpl_token_metadata::MplTokenMetadataError; +pub use token_metadata::TokenMetadataError; diff --git a/clients/rust/src/generated/errors/mpl_token_metadata.rs b/clients/rust/src/generated/errors/token_metadata.rs similarity index 99% rename from clients/rust/src/generated/errors/mpl_token_metadata.rs rename to clients/rust/src/generated/errors/token_metadata.rs index e83b0d09..abc4c3e5 100644 --- a/clients/rust/src/generated/errors/mpl_token_metadata.rs +++ b/clients/rust/src/generated/errors/token_metadata.rs @@ -9,7 +9,7 @@ use num_derive::FromPrimitive; use thiserror::Error; #[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)] -pub enum MplTokenMetadataError { +pub enum TokenMetadataError { /// 0x0 - #[error("")] InstructionUnpackError, @@ -591,7 +591,7 @@ pub enum MplTokenMetadataError { InvalidMetadataFlags, } -impl solana_program::program_error::PrintProgramError for MplTokenMetadataError { +impl solana_program::program_error::PrintProgramError for TokenMetadataError { fn print(&self) { solana_program::msg!(&self.to_string()); } diff --git a/clients/rust/src/generated/instructions/approve_collection_authority.rs b/clients/rust/src/generated/instructions/approve_collection_authority.rs index e848b6b2..b7fe1383 100644 --- a/clients/rust/src/generated/instructions/approve_collection_authority.rs +++ b/clients/rust/src/generated/instructions/approve_collection_authority.rs @@ -66,13 +66,13 @@ impl ApproveCollectionAuthority { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -257,13 +257,13 @@ impl<'a> ApproveCollectionAuthorityCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/approve_use_authority.rs b/clients/rust/src/generated/instructions/approve_use_authority.rs index c48a8759..d74aafdf 100644 --- a/clients/rust/src/generated/instructions/approve_use_authority.rs +++ b/clients/rust/src/generated/instructions/approve_use_authority.rs @@ -83,13 +83,13 @@ impl ApproveUseAuthority { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -330,13 +330,13 @@ impl<'a> ApproveUseAuthorityCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs index d1e1c400..f50aab56 100644 --- a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs +++ b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs @@ -53,13 +53,13 @@ impl BubblegumSetCollectionSize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -225,13 +225,13 @@ impl<'a> BubblegumSetCollectionSizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/burn_edition_nft.rs b/clients/rust/src/generated/instructions/burn_edition_nft.rs index d97852ce..6daf1eb0 100644 --- a/clients/rust/src/generated/instructions/burn_edition_nft.rs +++ b/clients/rust/src/generated/instructions/burn_edition_nft.rs @@ -79,7 +79,7 @@ impl BurnEditionNft { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -316,7 +316,7 @@ impl<'a> BurnEditionNftCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/burn_nft.rs b/clients/rust/src/generated/instructions/burn_nft.rs index 8c360217..719cbb22 100644 --- a/clients/rust/src/generated/instructions/burn_nft.rs +++ b/clients/rust/src/generated/instructions/burn_nft.rs @@ -61,13 +61,13 @@ impl BurnNft { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -237,13 +237,13 @@ impl<'a> BurnNftCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/burn_v1.rs b/clients/rust/src/generated/instructions/burn_v1.rs index 0328a615..fef41c9a 100644 --- a/clients/rust/src/generated/instructions/burn_v1.rs +++ b/clients/rust/src/generated/instructions/burn_v1.rs @@ -57,7 +57,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -71,7 +71,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -88,7 +88,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -99,7 +99,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -110,7 +110,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -150,7 +150,7 @@ impl BurnV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -396,7 +396,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -411,7 +411,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -430,7 +430,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -441,7 +441,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -452,7 +452,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -463,7 +463,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -474,7 +474,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -492,7 +492,7 @@ impl<'a> BurnV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/close_escrow_account.rs b/clients/rust/src/generated/instructions/close_escrow_account.rs index 20dd391a..29dddd82 100644 --- a/clients/rust/src/generated/instructions/close_escrow_account.rs +++ b/clients/rust/src/generated/instructions/close_escrow_account.rs @@ -66,7 +66,7 @@ impl CloseEscrowAccount { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -242,7 +242,7 @@ impl<'a> CloseEscrowAccountCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/collect.rs b/clients/rust/src/generated/instructions/collect.rs index a2f1cc6b..c03afb65 100644 --- a/clients/rust/src/generated/instructions/collect.rs +++ b/clients/rust/src/generated/instructions/collect.rs @@ -32,7 +32,7 @@ impl Collect { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -117,7 +117,7 @@ impl<'a> CollectCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs index 52ea6aae..452b35c5 100644 --- a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs +++ b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs @@ -38,7 +38,7 @@ impl ConvertMasterEditionV1ToV2 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -137,7 +137,7 @@ impl<'a> ConvertMasterEditionV1ToV2Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/create_escrow_account.rs b/clients/rust/src/generated/instructions/create_escrow_account.rs index ba1422b4..ac251142 100644 --- a/clients/rust/src/generated/instructions/create_escrow_account.rs +++ b/clients/rust/src/generated/instructions/create_escrow_account.rs @@ -72,13 +72,13 @@ impl CreateEscrowAccount { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -270,13 +270,13 @@ impl<'a> CreateEscrowAccountCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/create_master_edition_v3.rs b/clients/rust/src/generated/instructions/create_master_edition_v3.rs index 1a777d67..7771c7a3 100644 --- a/clients/rust/src/generated/instructions/create_master_edition_v3.rs +++ b/clients/rust/src/generated/instructions/create_master_edition_v3.rs @@ -73,13 +73,13 @@ impl CreateMasterEditionV3 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -282,13 +282,13 @@ impl<'a> CreateMasterEditionV3Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs index 94ce9fa4..cfa56411 100644 --- a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs +++ b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs @@ -63,13 +63,13 @@ impl CreateMetadataAccountV3 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -266,13 +266,13 @@ impl<'a> CreateMetadataAccountV3Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/create_v1.rs b/clients/rust/src/generated/instructions/create_v1.rs index 1130f331..62306cd1 100644 --- a/clients/rust/src/generated/instructions/create_v1.rs +++ b/clients/rust/src/generated/instructions/create_v1.rs @@ -55,7 +55,7 @@ impl CreateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -88,7 +88,7 @@ impl CreateV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -416,7 +416,7 @@ impl<'a> CreateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> CreateV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs index 0a22d6ab..e0fb1eb9 100644 --- a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs @@ -54,7 +54,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateAuthorityItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs index dfa48448..e1ab0c2b 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs @@ -54,7 +54,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateCollectionItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_collection_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_v1.rs index a1f6b936..df5225e5 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_v1.rs @@ -54,7 +54,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateCollectionV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs index 1932be8e..0bff7904 100644 --- a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs @@ -54,7 +54,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateDataItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_data_v1.rs b/clients/rust/src/generated/instructions/delegate_data_v1.rs index bc0c1a8b..a7ae00b0 100644 --- a/clients/rust/src/generated/instructions/delegate_data_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_v1.rs @@ -54,7 +54,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateDataV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs index d5fc256f..72185dff 100644 --- a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs @@ -56,7 +56,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -75,7 +75,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -86,7 +86,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -118,7 +118,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -129,7 +129,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -140,13 +140,13 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -411,7 +411,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -430,7 +430,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -441,7 +441,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -476,7 +476,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -487,7 +487,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -498,13 +498,13 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs index e0ef44a3..8c5407c7 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs @@ -54,7 +54,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateProgrammableConfigItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs index e66a79f5..72885e25 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs @@ -54,7 +54,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl DelegateProgrammableConfigV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -121,7 +121,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -132,7 +132,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -143,13 +143,13 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -390,7 +390,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -409,7 +409,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -420,7 +420,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,7 +461,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -472,7 +472,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,13 +483,13 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_sale_v1.rs b/clients/rust/src/generated/instructions/delegate_sale_v1.rs index 57860ecd..58841ce9 100644 --- a/clients/rust/src/generated/instructions/delegate_sale_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_sale_v1.rs @@ -54,7 +54,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -116,7 +116,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -127,7 +127,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -138,13 +138,13 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -392,7 +392,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -411,7 +411,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -422,7 +422,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -457,7 +457,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -468,7 +468,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -479,13 +479,13 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_staking_v1.rs b/clients/rust/src/generated/instructions/delegate_staking_v1.rs index 20bafd4b..5eb5cf61 100644 --- a/clients/rust/src/generated/instructions/delegate_staking_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_staking_v1.rs @@ -54,7 +54,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -116,7 +116,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -127,7 +127,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -138,13 +138,13 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -392,7 +392,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -411,7 +411,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -422,7 +422,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -457,7 +457,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -468,7 +468,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -479,13 +479,13 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_standard_v1.rs b/clients/rust/src/generated/instructions/delegate_standard_v1.rs index 35c46a6f..0183dc0f 100644 --- a/clients/rust/src/generated/instructions/delegate_standard_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_standard_v1.rs @@ -53,7 +53,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -382,7 +382,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -401,7 +401,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -412,7 +412,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -447,7 +447,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -458,7 +458,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -469,13 +469,13 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs index 6194c78c..3bbd50f1 100644 --- a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs @@ -54,7 +54,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -116,7 +116,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -127,7 +127,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -138,13 +138,13 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -392,7 +392,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -411,7 +411,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -422,7 +422,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -457,7 +457,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -468,7 +468,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -479,13 +479,13 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/delegate_utility_v1.rs b/clients/rust/src/generated/instructions/delegate_utility_v1.rs index abd290a3..409d30f5 100644 --- a/clients/rust/src/generated/instructions/delegate_utility_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_utility_v1.rs @@ -54,7 +54,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -84,7 +84,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -116,7 +116,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -127,7 +127,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -138,13 +138,13 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -392,7 +392,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -411,7 +411,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -422,7 +422,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -457,7 +457,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -468,7 +468,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -479,13 +479,13 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs index 058bf289..da7c922c 100644 --- a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs +++ b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs @@ -114,13 +114,13 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -425,13 +425,13 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/freeze_delegated_account.rs b/clients/rust/src/generated/instructions/freeze_delegated_account.rs index 4cc24a4b..2bb47913 100644 --- a/clients/rust/src/generated/instructions/freeze_delegated_account.rs +++ b/clients/rust/src/generated/instructions/freeze_delegated_account.rs @@ -49,7 +49,7 @@ impl FreezeDelegatedAccount { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -178,7 +178,7 @@ impl<'a> FreezeDelegatedAccountCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/lock_v1.rs b/clients/rust/src/generated/instructions/lock_v1.rs index 3dd6c9de..2a62b745 100644 --- a/clients/rust/src/generated/instructions/lock_v1.rs +++ b/clients/rust/src/generated/instructions/lock_v1.rs @@ -56,7 +56,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -76,7 +76,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -87,7 +87,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -109,7 +109,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,13 +131,13 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -368,7 +368,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -391,7 +391,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -402,7 +402,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -425,7 +425,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -436,7 +436,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -447,13 +447,13 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/migrate.rs b/clients/rust/src/generated/instructions/migrate.rs index b3ea856b..4918cc9c 100644 --- a/clients/rust/src/generated/instructions/migrate.rs +++ b/clients/rust/src/generated/instructions/migrate.rs @@ -104,7 +104,7 @@ impl Migrate { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,13 +115,13 @@ impl Migrate { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -413,7 +413,7 @@ impl<'a> MigrateCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,13 +424,13 @@ impl<'a> MigrateCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs index 60cf9847..9761a417 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs @@ -105,13 +105,13 @@ impl MintNewEditionFromMasterEditionViaToken { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -410,13 +410,13 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs index 222facb1..23a95fa6 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs @@ -122,13 +122,13 @@ impl MintNewEditionFromMasterEditionViaVaultProxy { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -482,13 +482,13 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/mint_v1.rs b/clients/rust/src/generated/instructions/mint_v1.rs index 70ca0c92..e9917299 100644 --- a/clients/rust/src/generated/instructions/mint_v1.rs +++ b/clients/rust/src/generated/instructions/mint_v1.rs @@ -59,7 +59,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -74,7 +74,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -85,7 +85,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -103,7 +103,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -133,7 +133,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -144,13 +144,13 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -419,7 +419,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -434,7 +434,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -445,7 +445,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -464,7 +464,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -495,7 +495,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -506,13 +506,13 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/print_v1.rs b/clients/rust/src/generated/instructions/print_v1.rs index 8b250990..1a870f11 100644 --- a/clients/rust/src/generated/instructions/print_v1.rs +++ b/clients/rust/src/generated/instructions/print_v1.rs @@ -86,7 +86,7 @@ impl PrintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -135,7 +135,7 @@ impl PrintV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -475,7 +475,7 @@ impl<'a> PrintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -525,7 +525,7 @@ impl<'a> PrintV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/puff_metadata.rs b/clients/rust/src/generated/instructions/puff_metadata.rs index 9a890420..6d150e4d 100644 --- a/clients/rust/src/generated/instructions/puff_metadata.rs +++ b/clients/rust/src/generated/instructions/puff_metadata.rs @@ -26,7 +26,7 @@ impl PuffMetadata { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -97,7 +97,7 @@ impl<'a> PuffMetadataCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/remove_creator_verification.rs b/clients/rust/src/generated/instructions/remove_creator_verification.rs index c48c5a23..a3e1b6ad 100644 --- a/clients/rust/src/generated/instructions/remove_creator_verification.rs +++ b/clients/rust/src/generated/instructions/remove_creator_verification.rs @@ -32,7 +32,7 @@ impl RemoveCreatorVerification { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -117,7 +117,7 @@ impl<'a> RemoveCreatorVerificationCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs index 48c3e949..46abf519 100644 --- a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs @@ -53,7 +53,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeAuthorityItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_collection_authority.rs b/clients/rust/src/generated/instructions/revoke_collection_authority.rs index 05cf84cd..96c46d50 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_authority.rs @@ -49,7 +49,7 @@ impl RevokeCollectionAuthority { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -189,7 +189,7 @@ impl<'a> RevokeCollectionAuthorityCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs index e4c7c345..2ea564d8 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs @@ -53,7 +53,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeCollectionItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_collection_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_v1.rs index 0496db12..768a771d 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_v1.rs @@ -53,7 +53,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeCollectionV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs index b661d1c9..9839ac10 100644 --- a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs @@ -53,7 +53,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeDataItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_data_v1.rs b/clients/rust/src/generated/instructions/revoke_data_v1.rs index 6a3bb6f7..cfdc62bf 100644 --- a/clients/rust/src/generated/instructions/revoke_data_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_v1.rs @@ -53,7 +53,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeDataV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs index 7bf02428..c9c19b5f 100644 --- a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs @@ -53,7 +53,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_migration_v1.rs b/clients/rust/src/generated/instructions/revoke_migration_v1.rs index 01ab5943..e934b67f 100644 --- a/clients/rust/src/generated/instructions/revoke_migration_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_migration_v1.rs @@ -53,7 +53,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs index 6035a956..e871925b 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs @@ -53,7 +53,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeProgrammableConfigItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs index 9cb13ea6..138c9508 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs @@ -53,7 +53,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -94,7 +94,7 @@ impl RevokeProgrammableConfigV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,7 +131,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -142,13 +142,13 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -380,7 +380,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,7 +410,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -424,7 +424,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -451,7 +451,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -462,7 +462,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,13 +473,13 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_sale_v1.rs b/clients/rust/src/generated/instructions/revoke_sale_v1.rs index ef3f4aac..dd8aba6f 100644 --- a/clients/rust/src/generated/instructions/revoke_sale_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_sale_v1.rs @@ -53,7 +53,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_staking_v1.rs b/clients/rust/src/generated/instructions/revoke_staking_v1.rs index eb26ee86..ba83de73 100644 --- a/clients/rust/src/generated/instructions/revoke_staking_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_staking_v1.rs @@ -53,7 +53,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_standard_v1.rs b/clients/rust/src/generated/instructions/revoke_standard_v1.rs index db24484d..5bdefeec 100644 --- a/clients/rust/src/generated/instructions/revoke_standard_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_standard_v1.rs @@ -53,7 +53,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs index 5decc136..58fab539 100644 --- a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs @@ -53,7 +53,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_use_authority.rs b/clients/rust/src/generated/instructions/revoke_use_authority.rs index d5e37c5d..446d88f0 100644 --- a/clients/rust/src/generated/instructions/revoke_use_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_use_authority.rs @@ -71,13 +71,13 @@ impl RevokeUseAuthority { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -275,13 +275,13 @@ impl<'a> RevokeUseAuthorityCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/revoke_utility_v1.rs b/clients/rust/src/generated/instructions/revoke_utility_v1.rs index a963e078..9113f2f6 100644 --- a/clients/rust/src/generated/instructions/revoke_utility_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_utility_v1.rs @@ -53,7 +53,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -72,7 +72,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -115,7 +115,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -126,7 +126,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,13 +137,13 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -374,7 +374,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -393,7 +393,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -404,7 +404,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -439,7 +439,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -461,13 +461,13 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/set_and_verify_collection.rs b/clients/rust/src/generated/instructions/set_and_verify_collection.rs index 74b07adf..f572c578 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_collection.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_collection.rs @@ -68,13 +68,13 @@ impl SetAndVerifyCollection { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -264,13 +264,13 @@ impl<'a> SetAndVerifyCollectionCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs index 08d0547f..bee2748d 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs @@ -68,13 +68,13 @@ impl SetAndVerifySizedCollectionItem { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -264,13 +264,13 @@ impl<'a> SetAndVerifySizedCollectionItemCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/set_collection_size.rs b/clients/rust/src/generated/instructions/set_collection_size.rs index 928126b8..09935087 100644 --- a/clients/rust/src/generated/instructions/set_collection_size.rs +++ b/clients/rust/src/generated/instructions/set_collection_size.rs @@ -47,13 +47,13 @@ impl SetCollectionSize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -202,13 +202,13 @@ impl<'a> SetCollectionSizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/set_token_standard.rs b/clients/rust/src/generated/instructions/set_token_standard.rs index ca0dd919..120cefa7 100644 --- a/clients/rust/src/generated/instructions/set_token_standard.rs +++ b/clients/rust/src/generated/instructions/set_token_standard.rs @@ -43,13 +43,13 @@ impl SetTokenStandard { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -167,13 +167,13 @@ impl<'a> SetTokenStandardCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/sign_metadata.rs b/clients/rust/src/generated/instructions/sign_metadata.rs index 755e8fd5..29a43a60 100644 --- a/clients/rust/src/generated/instructions/sign_metadata.rs +++ b/clients/rust/src/generated/instructions/sign_metadata.rs @@ -32,7 +32,7 @@ impl SignMetadata { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -117,7 +117,7 @@ impl<'a> SignMetadataCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/thaw_delegated_account.rs b/clients/rust/src/generated/instructions/thaw_delegated_account.rs index 0a001782..5e0f04e7 100644 --- a/clients/rust/src/generated/instructions/thaw_delegated_account.rs +++ b/clients/rust/src/generated/instructions/thaw_delegated_account.rs @@ -49,7 +49,7 @@ impl ThawDelegatedAccount { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -178,7 +178,7 @@ impl<'a> ThawDelegatedAccountCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs index 5a7dab91..39cc43a9 100644 --- a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs +++ b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs @@ -97,13 +97,13 @@ impl TransferOutOfEscrow { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -365,13 +365,13 @@ impl<'a> TransferOutOfEscrowCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/transfer_v1.rs b/clients/rust/src/generated/instructions/transfer_v1.rs index 7e88c76b..c5998fec 100644 --- a/clients/rust/src/generated/instructions/transfer_v1.rs +++ b/clients/rust/src/generated/instructions/transfer_v1.rs @@ -81,7 +81,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -92,7 +92,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -103,7 +103,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -137,7 +137,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -148,13 +148,13 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -472,7 +472,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -483,7 +483,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -494,7 +494,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -529,7 +529,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -540,13 +540,13 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/unlock_v1.rs b/clients/rust/src/generated/instructions/unlock_v1.rs index 8a3c46e6..cb80c9a5 100644 --- a/clients/rust/src/generated/instructions/unlock_v1.rs +++ b/clients/rust/src/generated/instructions/unlock_v1.rs @@ -56,7 +56,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -76,7 +76,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -87,7 +87,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -109,7 +109,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -120,7 +120,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -131,13 +131,13 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -368,7 +368,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -391,7 +391,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -402,7 +402,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -425,7 +425,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -436,7 +436,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -447,13 +447,13 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/unverify_collection.rs b/clients/rust/src/generated/instructions/unverify_collection.rs index 1cf4edf3..97a3e0e3 100644 --- a/clients/rust/src/generated/instructions/unverify_collection.rs +++ b/clients/rust/src/generated/instructions/unverify_collection.rs @@ -57,13 +57,13 @@ impl UnverifyCollection { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -222,13 +222,13 @@ impl<'a> UnverifyCollectionCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/unverify_collection_v1.rs b/clients/rust/src/generated/instructions/unverify_collection_v1.rs index 35365b37..ab8c0265 100644 --- a/clients/rust/src/generated/instructions/unverify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_collection_v1.rs @@ -43,7 +43,7 @@ impl UnverifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -62,7 +62,7 @@ impl UnverifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -76,7 +76,7 @@ impl UnverifyCollectionV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -234,7 +234,7 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -253,7 +253,7 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -267,7 +267,7 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/unverify_creator_v1.rs b/clients/rust/src/generated/instructions/unverify_creator_v1.rs index 06874b3f..c835637e 100644 --- a/clients/rust/src/generated/instructions/unverify_creator_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_creator_v1.rs @@ -43,7 +43,7 @@ impl UnverifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -58,7 +58,7 @@ impl UnverifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -69,7 +69,7 @@ impl UnverifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -83,7 +83,7 @@ impl UnverifyCreatorV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -242,7 +242,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -257,7 +257,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -268,7 +268,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -282,7 +282,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs index a97984c1..7cf055ad 100644 --- a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs @@ -62,13 +62,13 @@ impl UnverifySizedCollectionItem { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -241,13 +241,13 @@ impl<'a> UnverifySizedCollectionItemCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs index b2e60cc8..8211ab10 100644 --- a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs @@ -54,7 +54,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -64,7 +64,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -81,7 +81,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -103,7 +103,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -114,13 +114,13 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -366,7 +366,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -376,7 +376,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -395,7 +395,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -418,7 +418,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -429,13 +429,13 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs index e6d6d9fc..3a0e118b 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs @@ -53,7 +53,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -63,7 +63,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -80,7 +80,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -102,7 +102,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -113,13 +113,13 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -337,7 +337,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -347,7 +347,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -366,7 +366,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -389,7 +389,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -400,13 +400,13 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs index a27d8c6c..dc77749c 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs @@ -53,7 +53,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -63,7 +63,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -80,7 +80,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -102,7 +102,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -113,13 +113,13 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -337,7 +337,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -347,7 +347,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -366,7 +366,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -389,7 +389,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -400,13 +400,13 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs index 9ad7c9c8..544a5c91 100644 --- a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs @@ -53,7 +53,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -63,7 +63,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -80,7 +80,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -102,7 +102,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -113,13 +113,13 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -347,7 +347,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -357,7 +357,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -376,7 +376,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,13 +410,13 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs index b7b36a4b..5a176829 100644 --- a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs @@ -53,7 +53,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -63,7 +63,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -80,7 +80,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -102,7 +102,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -113,13 +113,13 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -347,7 +347,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -357,7 +357,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -376,7 +376,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -399,7 +399,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -410,13 +410,13 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs index fc56df63..e4583e71 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs @@ -53,7 +53,7 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -106,13 +106,13 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -329,7 +329,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -352,7 +352,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -375,7 +375,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -386,13 +386,13 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs index aaad52ff..dd508e5e 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs @@ -53,7 +53,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -73,7 +73,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -95,7 +95,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -106,13 +106,13 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -329,7 +329,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -352,7 +352,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -375,7 +375,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -386,13 +386,13 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs index fc1c1231..d005507e 100644 --- a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs @@ -59,7 +59,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -69,7 +69,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -86,7 +86,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -108,7 +108,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -119,13 +119,13 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -421,7 +421,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -431,7 +431,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -450,7 +450,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -473,7 +473,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -484,13 +484,13 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs index ba483728..ee3a9746 100644 --- a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs +++ b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs @@ -34,7 +34,7 @@ impl UpdateMetadataAccountV2 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -160,7 +160,7 @@ impl<'a> UpdateMetadataAccountV2Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs index e31fc689..278c769f 100644 --- a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs +++ b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs @@ -36,7 +36,7 @@ impl UpdatePrimarySaleHappenedViaToken { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -135,7 +135,7 @@ impl<'a> UpdatePrimarySaleHappenedViaTokenCpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/update_v1.rs b/clients/rust/src/generated/instructions/update_v1.rs index 59cc5ded..fcf0c01d 100644 --- a/clients/rust/src/generated/instructions/update_v1.rs +++ b/clients/rust/src/generated/instructions/update_v1.rs @@ -58,7 +58,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -68,7 +68,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -85,7 +85,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -107,7 +107,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -118,13 +118,13 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -411,7 +411,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -421,7 +421,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -440,7 +440,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -463,7 +463,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -474,13 +474,13 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/use_v1.rs b/clients/rust/src/generated/instructions/use_v1.rs index 82c1b082..950291d7 100644 --- a/clients/rust/src/generated/instructions/use_v1.rs +++ b/clients/rust/src/generated/instructions/use_v1.rs @@ -54,7 +54,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -62,7 +62,7 @@ impl UseV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -79,7 +79,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -101,7 +101,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -112,7 +112,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -123,13 +123,13 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -353,7 +353,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -363,7 +363,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -382,7 +382,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -405,7 +405,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -416,7 +416,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -427,13 +427,13 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/utilize.rs b/clients/rust/src/generated/instructions/utilize.rs index 210833ca..95cfbf06 100644 --- a/clients/rust/src/generated/instructions/utilize.rs +++ b/clients/rust/src/generated/instructions/utilize.rs @@ -81,7 +81,7 @@ impl Utilize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -91,13 +91,13 @@ impl Utilize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -333,7 +333,7 @@ impl<'a> UtilizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -344,13 +344,13 @@ impl<'a> UtilizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: self.__args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/verify_collection.rs b/clients/rust/src/generated/instructions/verify_collection.rs index 2d9e1263..20003b81 100644 --- a/clients/rust/src/generated/instructions/verify_collection.rs +++ b/clients/rust/src/generated/instructions/verify_collection.rs @@ -62,13 +62,13 @@ impl VerifyCollection { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -241,13 +241,13 @@ impl<'a> VerifyCollectionCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/verify_collection_v1.rs b/clients/rust/src/generated/instructions/verify_collection_v1.rs index 1bcc4d86..3b604ded 100644 --- a/clients/rust/src/generated/instructions/verify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/verify_collection_v1.rs @@ -45,7 +45,7 @@ impl VerifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -64,7 +64,7 @@ impl VerifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -75,7 +75,7 @@ impl VerifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -89,7 +89,7 @@ impl VerifyCollectionV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -261,7 +261,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -280,7 +280,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -291,7 +291,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -305,7 +305,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/verify_creator_v1.rs b/clients/rust/src/generated/instructions/verify_creator_v1.rs index 4652a80e..a3c9196b 100644 --- a/clients/rust/src/generated/instructions/verify_creator_v1.rs +++ b/clients/rust/src/generated/instructions/verify_creator_v1.rs @@ -45,7 +45,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -60,7 +60,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -71,7 +71,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -82,7 +82,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -96,7 +96,7 @@ impl VerifyCreatorV1 { )); solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -269,7 +269,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -284,7 +284,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -295,7 +295,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -306,7 +306,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } @@ -320,7 +320,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs index 44112689..f9bdee16 100644 --- a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs @@ -62,13 +62,13 @@ impl VerifySizedCollectionItem { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), } @@ -241,13 +241,13 @@ impl<'a> VerifySizedCollectionItemCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, + crate::TOKEN_METADATA_ID, false, )); } let instruction = solana_program::instruction::Instruction { - program_id: crate::MPL_TOKEN_METADATA_ID, + program_id: crate::TOKEN_METADATA_ID, accounts, data: args.try_to_vec().unwrap(), }; diff --git a/clients/rust/src/generated/programs.rs b/clients/rust/src/generated/programs.rs index a485a909..cb70b16b 100644 --- a/clients/rust/src/generated/programs.rs +++ b/clients/rust/src/generated/programs.rs @@ -7,5 +7,5 @@ use solana_program::{pubkey, pubkey::Pubkey}; -/// `mpl_token_metadata` program ID. -pub const MPL_TOKEN_METADATA_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); +/// `token_metadata` program ID. +pub const TOKEN_METADATA_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); From 6a2627076f4f3c50edf48e0143411fd9b1463c86 Mon Sep 17 00:00:00 2001 From: Fernando Otero Date: Sun, 20 Aug 2023 15:50:59 +0300 Subject: [PATCH 13/31] Fix program name --- clients/js/src/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/js/src/plugin.ts b/clients/js/src/plugin.ts index b2fdc0f8..382f75e8 100644 --- a/clients/js/src/plugin.ts +++ b/clients/js/src/plugin.ts @@ -1,10 +1,10 @@ import { UmiPlugin } from '@metaplex-foundation/umi'; import { mplToolbox } from '@metaplex-foundation/mpl-toolbox'; -import { createMplTokenMetadataProgram } from './generated'; +import { createTokenMetadataProgram } from './generated'; export const mplTokenMetadata = (): UmiPlugin => ({ install(umi) { umi.use(mplToolbox()); - umi.programs.add(createMplTokenMetadataProgram(), false); + umi.programs.add(createTokenMetadataProgram(), false); }, }); From dcc852a41e5efd29e713a203877ff8d385c23d79 Mon Sep 17 00:00:00 2001 From: Fernando Otero Date: Sun, 20 Aug 2023 15:56:52 +0300 Subject: [PATCH 14/31] Fix binary name --- configs/validator.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/validator.cjs b/configs/validator.cjs index 14cd3e82..0a51fde9 100755 --- a/configs/validator.cjs +++ b/configs/validator.cjs @@ -13,7 +13,7 @@ module.exports = { { label: "Token Metadata", programId: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", - deployPath: getProgram("mpl_token_metadata.so"), + deployPath: getProgram("token_metadata.so"), }, { label: "Token Auth Rules", From da6b5eda929c813ec7598c97c30c74076b4bcc6f Mon Sep 17 00:00:00 2001 From: febo Date: Mon, 21 Aug 2023 00:47:29 +0300 Subject: [PATCH 15/31] Update description --- clients/rust/README.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/clients/rust/README.md b/clients/rust/README.md index 3b5f01e0..366ed7b6 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -1,6 +1,20 @@ - # Metaplex Token Metadata Client SDK - - Rust client library for the Token Metadata program. +

+ Metaplex Token Metadata SDK +

+

+ Rust library for interacting with Token Metadata program. +

+

+ + +

+ + ## Getting started + +From your project folder: + ```bash + cargo add mpl-token-metadata + ``` ## Structure @@ -192,13 +206,16 @@ impl Metadata { } } ``` -> If a bump seed is known, it is _cheaper_ (less compute units) to use the `create_pda` function, in particular for on-chain code. +> If a bump seed is known, it is _cheaper_ (in terms of compute units) to use the `create_pda` function, in particular for on-chain code. ## Why using a client library? Using a program crate as a dependency has its caveats. The main one is that you are bound to the same dependencies of that program, which tend to be quite a few. In many cases, this leads to dependency problems when trying to update crate versions. Secondly, the program crate is generated from the program source code, which its main purpose is to offer the functionality of the program, not necessarily a _friendly_ client API. - Enter a client crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. + Enter an SDK crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. + + > **Note:** + > Although the SDK has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies from the `solana-program`. ## Testing From dd24a6273ac4b9277f8fc89d389524f22d9438fe Mon Sep 17 00:00:00 2001 From: febo Date: Mon, 21 Aug 2023 00:51:43 +0300 Subject: [PATCH 16/31] Fix markdown --- clients/rust/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/rust/README.md b/clients/rust/README.md index 366ed7b6..22a72a77 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -214,8 +214,8 @@ impl Metadata { Enter an SDK crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. - > **Note:** - > Although the SDK has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies from the `solana-program`. + > **Note** + > Although the SDK crate has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies from the `solana-program`. ## Testing From 08406b35cec45045d71c6b92c5359ae713724115 Mon Sep 17 00:00:00 2001 From: febo Date: Mon, 21 Aug 2023 19:24:52 +0300 Subject: [PATCH 17/31] Bump kinobi version --- .../accounts/collectionAuthorityRecord.ts | 4 +- clients/js/src/generated/accounts/edition.ts | 2 +- .../src/generated/accounts/editionMarker.ts | 4 +- .../src/generated/accounts/editionMarkerV2.ts | 2 +- clients/js/src/generated/accounts/index.ts | 3 - .../src/generated/accounts/masterEdition.ts | 4 +- .../src/generated/accounts/masterEditionV1.ts | 172 ------------ clients/js/src/generated/accounts/metadata.ts | 4 +- .../accounts/metadataDelegateRecord.ts | 4 +- .../generated/accounts/reservationListV1.ts | 180 ------------- .../generated/accounts/reservationListV2.ts | 190 -------------- .../generated/accounts/tokenOwnedEscrow.ts | 2 +- .../js/src/generated/accounts/tokenRecord.ts | 4 +- .../generated/accounts/useAuthorityRecord.ts | 4 +- clients/js/src/generated/errors/index.ts | 2 +- .../{tokenMetadata.ts => mplTokenMetadata.ts} | 4 +- .../approveCollectionAuthority.ts | 2 +- .../instructions/approveUseAuthority.ts | 2 +- .../bubblegumSetCollectionSize.ts | 2 +- .../generated/instructions/burnEditionNft.ts | 2 +- .../js/src/generated/instructions/burnNft.ts | 2 +- .../js/src/generated/instructions/burnV1.ts | 2 +- .../instructions/closeEscrowAccount.ts | 2 +- .../js/src/generated/instructions/collect.ts | 2 +- .../convertMasterEditionV1ToV2.ts | 2 +- .../instructions/createEscrowAccount.ts | 2 +- .../instructions/createMasterEditionV3.ts | 2 +- .../instructions/createMetadataAccountV3.ts | 2 +- .../js/src/generated/instructions/createV1.ts | 2 +- .../instructions/delegateAuthorityItemV1.ts | 2 +- .../instructions/delegateCollectionItemV1.ts | 2 +- .../instructions/delegateCollectionV1.ts | 2 +- .../instructions/delegateDataItemV1.ts | 2 +- .../generated/instructions/delegateDataV1.ts | 2 +- .../instructions/delegateLockedTransferV1.ts | 2 +- .../delegateProgrammableConfigItemV1.ts | 2 +- .../delegateProgrammableConfigV1.ts | 2 +- .../generated/instructions/delegateSaleV1.ts | 2 +- .../instructions/delegateStakingV1.ts | 2 +- .../instructions/delegateStandardV1.ts | 2 +- .../instructions/delegateTransferV1.ts | 2 +- .../instructions/delegateUtilityV1.ts | 2 +- ...ditionFromMasterEditionViaPrintingToken.ts | 2 +- .../instructions/freezeDelegatedAccount.ts | 2 +- .../js/src/generated/instructions/lockV1.ts | 2 +- .../js/src/generated/instructions/migrate.ts | 2 +- ...mintNewEditionFromMasterEditionViaToken.ts | 2 +- ...ewEditionFromMasterEditionViaVaultProxy.ts | 2 +- .../js/src/generated/instructions/mintV1.ts | 2 +- .../js/src/generated/instructions/printV1.ts | 2 +- .../generated/instructions/puffMetadata.ts | 2 +- .../instructions/removeCreatorVerification.ts | 2 +- .../instructions/revokeAuthorityItemV1.ts | 2 +- .../instructions/revokeCollectionAuthority.ts | 2 +- .../instructions/revokeCollectionItemV1.ts | 2 +- .../instructions/revokeCollectionV1.ts | 2 +- .../instructions/revokeDataItemV1.ts | 2 +- .../generated/instructions/revokeDataV1.ts | 2 +- .../instructions/revokeLockedTransferV1.ts | 2 +- .../instructions/revokeMigrationV1.ts | 2 +- .../revokeProgrammableConfigItemV1.ts | 2 +- .../revokeProgrammableConfigV1.ts | 2 +- .../generated/instructions/revokeSaleV1.ts | 2 +- .../generated/instructions/revokeStakingV1.ts | 2 +- .../instructions/revokeStandardV1.ts | 2 +- .../instructions/revokeTransferV1.ts | 2 +- .../instructions/revokeUseAuthority.ts | 2 +- .../generated/instructions/revokeUtilityV1.ts | 2 +- .../instructions/setAndVerifyCollection.ts | 2 +- .../setAndVerifySizedCollectionItem.ts | 2 +- .../instructions/setCollectionSize.ts | 2 +- .../instructions/setTokenStandard.ts | 2 +- .../generated/instructions/signMetadata.ts | 2 +- .../instructions/thawDelegatedAccount.ts | 2 +- .../instructions/transferOutOfEscrow.ts | 2 +- .../src/generated/instructions/transferV1.ts | 2 +- .../js/src/generated/instructions/unlockV1.ts | 2 +- .../instructions/unverifyCollection.ts | 2 +- .../instructions/unverifyCollectionV1.ts | 2 +- .../instructions/unverifyCreatorV1.ts | 2 +- .../unverifySizedCollectionItem.ts | 2 +- .../updateAsAuthorityItemDelegateV2.ts | 2 +- .../updateAsCollectionDelegateV2.ts | 2 +- .../updateAsCollectionItemDelegateV2.ts | 2 +- .../instructions/updateAsDataDelegateV2.ts | 2 +- .../updateAsDataItemDelegateV2.ts | 2 +- .../updateAsProgrammableConfigDelegateV2.ts | 2 +- ...pdateAsProgrammableConfigItemDelegateV2.ts | 2 +- .../instructions/updateAsUpdateAuthorityV2.ts | 2 +- .../instructions/updateMetadataAccountV2.ts | 2 +- .../updatePrimarySaleHappenedViaToken.ts | 2 +- .../js/src/generated/instructions/updateV1.ts | 2 +- .../js/src/generated/instructions/useV1.ts | 2 +- .../js/src/generated/instructions/utilize.ts | 2 +- .../instructions/verifyCollection.ts | 2 +- .../instructions/verifyCollectionV1.ts | 2 +- .../generated/instructions/verifyCreatorV1.ts | 2 +- .../instructions/verifySizedCollectionItem.ts | 2 +- clients/js/src/generated/programs/index.ts | 2 +- .../{tokenMetadata.ts => mplTokenMetadata.ts} | 26 +- clients/js/src/plugin.ts | 4 +- clients/rust/Cargo.lock | 244 +++++++++--------- clients/rust/Cargo.toml | 6 +- clients/rust/README.md | 6 +- .../accounts/collection_authority_record.rs | 8 +- .../src/generated/accounts/edition_marker.rs | 8 +- .../src/generated/accounts/master_edition.rs | 8 +- .../generated/accounts/master_edition_v1.rs | 31 --- .../rust/src/generated/accounts/metadata.rs | 8 +- .../accounts/metadata_delegate_record.rs | 8 +- clients/rust/src/generated/accounts/mod.rs | 6 - .../generated/accounts/reservation_list_v1.rs | 31 --- .../generated/accounts/reservation_list_v2.rs | 33 --- .../src/generated/accounts/token_record.rs | 8 +- .../accounts/use_authority_record.rs | 8 +- clients/rust/src/generated/errors/mod.rs | 4 +- ...oken_metadata.rs => mpl_token_metadata.rs} | 4 +- .../approve_collection_authority.rs | 30 ++- .../instructions/approve_use_authority.rs | 55 ++-- .../bubblegum_set_collection_size.rs | 55 ++-- .../instructions/burn_edition_nft.rs | 22 +- .../src/generated/instructions/burn_nft.rs | 26 +- .../src/generated/instructions/burn_v1.rs | 80 +++--- .../instructions/close_escrow_account.rs | 26 +- .../src/generated/instructions/collect.rs | 22 +- .../convert_master_edition_v1_to_v2.rs | 26 +- .../instructions/create_escrow_account.rs | 30 ++- .../instructions/create_master_edition_v3.rs | 49 ++-- .../create_metadata_account_v3.rs | 70 ++--- .../src/generated/instructions/create_v1.rs | 154 ++++++----- .../delegate_authority_item_v1.rs | 82 +++--- .../delegate_collection_item_v1.rs | 82 +++--- .../instructions/delegate_collection_v1.rs | 82 +++--- .../instructions/delegate_data_item_v1.rs | 82 +++--- .../instructions/delegate_data_v1.rs | 78 +++--- .../delegate_locked_transfer_v1.rs | 91 ++++--- .../delegate_programmable_config_item_v1.rs | 82 +++--- .../delegate_programmable_config_v1.rs | 82 +++--- .../instructions/delegate_sale_v1.rs | 81 +++--- .../instructions/delegate_staking_v1.rs | 85 +++--- .../instructions/delegate_standard_v1.rs | 80 ++++-- .../instructions/delegate_transfer_v1.rs | 85 +++--- .../instructions/delegate_utility_v1.rs | 85 +++--- ..._from_master_edition_via_printing_token.rs | 30 ++- .../instructions/freeze_delegated_account.rs | 26 +- .../src/generated/instructions/lock_v1.rs | 74 ++++-- .../src/generated/instructions/migrate.rs | 30 +-- ...w_edition_from_master_edition_via_token.rs | 59 +++-- ...ion_from_master_edition_via_vault_proxy.rs | 59 +++-- .../src/generated/instructions/mint_v1.rs | 81 +++--- .../src/generated/instructions/print_v1.rs | 45 ++-- .../generated/instructions/puff_metadata.rs | 22 +- .../remove_creator_verification.rs | 26 +- .../instructions/revoke_authority_item_v1.rs | 54 ++-- .../revoke_collection_authority.rs | 26 +- .../instructions/revoke_collection_item_v1.rs | 54 ++-- .../instructions/revoke_collection_v1.rs | 54 ++-- .../instructions/revoke_data_item_v1.rs | 50 ++-- .../generated/instructions/revoke_data_v1.rs | 50 ++-- .../instructions/revoke_locked_transfer_v1.rs | 50 ++-- .../instructions/revoke_migration_v1.rs | 50 ++-- .../revoke_programmable_config_item_v1.rs | 54 ++-- .../revoke_programmable_config_v1.rs | 54 ++-- .../generated/instructions/revoke_sale_v1.rs | 46 ++-- .../instructions/revoke_staking_v1.rs | 46 ++-- .../instructions/revoke_standard_v1.rs | 46 ++-- .../instructions/revoke_transfer_v1.rs | 46 ++-- .../instructions/revoke_use_authority.rs | 30 ++- .../instructions/revoke_utility_v1.rs | 46 ++-- .../instructions/set_and_verify_collection.rs | 30 ++- .../set_and_verify_sized_collection_item.rs | 30 ++- .../instructions/set_collection_size.rs | 55 ++-- .../instructions/set_token_standard.rs | 26 +- .../generated/instructions/sign_metadata.rs | 22 +- .../instructions/thaw_delegated_account.rs | 26 +- .../instructions/transfer_out_of_escrow.rs | 64 +++-- .../src/generated/instructions/transfer_v1.rs | 77 ++++-- .../src/generated/instructions/unlock_v1.rs | 74 ++++-- .../instructions/unverify_collection.rs | 30 ++- .../instructions/unverify_collection_v1.rs | 34 +-- .../instructions/unverify_creator_v1.rs | 38 +-- .../unverify_sized_collection_item.rs | 30 ++- .../update_as_authority_item_delegate_v2.rs | 94 ++++--- .../update_as_collection_delegate_v2.rs | 85 ++++-- .../update_as_collection_item_delegate_v2.rs | 85 ++++-- .../update_as_data_delegate_v2.rs | 89 ++++--- .../update_as_data_item_delegate_v2.rs | 89 ++++--- ...date_as_programmable_config_delegate_v2.rs | 81 ++++-- ...as_programmable_config_item_delegate_v2.rs | 81 ++++-- .../update_as_update_authority_v2.rs | 136 +++++++--- .../update_metadata_account_v2.rs | 71 +++-- .../update_primary_sale_happened_via_token.rs | 26 +- .../src/generated/instructions/update_v1.rs | 129 ++++++--- .../rust/src/generated/instructions/use_v1.rs | 74 ++++-- .../src/generated/instructions/utilize.rs | 55 ++-- .../instructions/verify_collection.rs | 26 +- .../instructions/verify_collection_v1.rs | 38 +-- .../instructions/verify_creator_v1.rs | 38 ++- .../verify_sized_collection_item.rs | 30 ++- clients/rust/src/generated/programs.rs | 4 +- clients/rust/src/lib.rs | 4 +- clients/rust/tests/create.rs | 32 ++- clients/rust/tests/lock.rs | 6 +- clients/rust/tests/setup/digital_asset.rs | 2 +- clients/rust/tests/setup/mod.rs | 8 +- configs/kinobi.cjs | 8 + package.json | 2 +- pnpm-lock.yaml | 8 +- 208 files changed, 3092 insertions(+), 2877 deletions(-) delete mode 100644 clients/js/src/generated/accounts/masterEditionV1.ts delete mode 100644 clients/js/src/generated/accounts/reservationListV1.ts delete mode 100644 clients/js/src/generated/accounts/reservationListV2.ts rename clients/js/src/generated/errors/{tokenMetadata.ts => mplTokenMetadata.ts} (99%) rename clients/js/src/generated/programs/{tokenMetadata.ts => mplTokenMetadata.ts} (58%) delete mode 100644 clients/rust/src/generated/accounts/master_edition_v1.rs delete mode 100644 clients/rust/src/generated/accounts/reservation_list_v1.rs delete mode 100644 clients/rust/src/generated/accounts/reservation_list_v2.rs rename clients/rust/src/generated/errors/{token_metadata.rs => mpl_token_metadata.rs} (99%) diff --git a/clients/js/src/generated/accounts/collectionAuthorityRecord.ts b/clients/js/src/generated/accounts/collectionAuthorityRecord.ts index f74f90bc..2705c8b2 100644 --- a/clients/js/src/generated/accounts/collectionAuthorityRecord.ts +++ b/clients/js/src/generated/accounts/collectionAuthorityRecord.ts @@ -163,7 +163,7 @@ export function getCollectionAuthorityRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -192,7 +192,7 @@ export function findCollectionAuthorityRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/edition.ts b/clients/js/src/generated/accounts/edition.ts index 173a30e1..fcfb9e44 100644 --- a/clients/js/src/generated/accounts/edition.ts +++ b/clients/js/src/generated/accounts/edition.ts @@ -139,7 +139,7 @@ export function getEditionGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/editionMarker.ts b/clients/js/src/generated/accounts/editionMarker.ts index db3e92d6..c25f3fd8 100644 --- a/clients/js/src/generated/accounts/editionMarker.ts +++ b/clients/js/src/generated/accounts/editionMarker.ts @@ -139,7 +139,7 @@ export function getEditionMarkerGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -167,7 +167,7 @@ export function findEditionMarkerPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/editionMarkerV2.ts b/clients/js/src/generated/accounts/editionMarkerV2.ts index 848016df..ea07c2b6 100644 --- a/clients/js/src/generated/accounts/editionMarkerV2.ts +++ b/clients/js/src/generated/accounts/editionMarkerV2.ts @@ -134,7 +134,7 @@ export function getEditionMarkerV2GpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/index.ts b/clients/js/src/generated/accounts/index.ts index b09ea82f..87dff227 100644 --- a/clients/js/src/generated/accounts/index.ts +++ b/clients/js/src/generated/accounts/index.ts @@ -11,11 +11,8 @@ export * from './edition'; export * from './editionMarker'; export * from './editionMarkerV2'; export * from './masterEdition'; -export * from './masterEditionV1'; export * from './metadata'; export * from './metadataDelegateRecord'; -export * from './reservationListV1'; -export * from './reservationListV2'; export * from './tokenOwnedEscrow'; export * from './tokenRecord'; export * from './useAuthorityRecord'; diff --git a/clients/js/src/generated/accounts/masterEdition.ts b/clients/js/src/generated/accounts/masterEdition.ts index 3079bed0..35ae997d 100644 --- a/clients/js/src/generated/accounts/masterEdition.ts +++ b/clients/js/src/generated/accounts/masterEdition.ts @@ -149,7 +149,7 @@ export function getMasterEditionGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -180,7 +180,7 @@ export function findMasterEditionPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/masterEditionV1.ts b/clients/js/src/generated/accounts/masterEditionV1.ts deleted file mode 100644 index dcdb6495..00000000 --- a/clients/js/src/generated/accounts/masterEditionV1.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { - Account, - Context, - Option, - OptionOrNullable, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; -import { - Serializer, - option, - publicKey as publicKeySerializer, - struct, - u64, -} from '@metaplex-foundation/umi/serializers'; -import { Key, KeyArgs, getKeySerializer } from '../types'; - -export type MasterEditionV1 = Account; - -export type MasterEditionV1AccountData = { - key: Key; - supply: bigint; - maxSupply: Option; - printingMint: PublicKey; - oneTimePrintingAuthorizationMint: PublicKey; -}; - -export type MasterEditionV1AccountDataArgs = { - key: KeyArgs; - supply: number | bigint; - maxSupply: OptionOrNullable; - printingMint: PublicKey; - oneTimePrintingAuthorizationMint: PublicKey; -}; - -/** @deprecated Use `getMasterEditionV1AccountDataSerializer()` without any argument instead. */ -export function getMasterEditionV1AccountDataSerializer( - _context: object -): Serializer; -export function getMasterEditionV1AccountDataSerializer(): Serializer< - MasterEditionV1AccountDataArgs, - MasterEditionV1AccountData ->; -export function getMasterEditionV1AccountDataSerializer( - _context: object = {} -): Serializer { - return struct( - [ - ['key', getKeySerializer()], - ['supply', u64()], - ['maxSupply', option(u64())], - ['printingMint', publicKeySerializer()], - ['oneTimePrintingAuthorizationMint', publicKeySerializer()], - ], - { description: 'MasterEditionV1AccountData' } - ) as Serializer; -} - -/** @deprecated Use `deserializeMasterEditionV1(rawAccount)` without any context instead. */ -export function deserializeMasterEditionV1( - context: object, - rawAccount: RpcAccount -): MasterEditionV1; -export function deserializeMasterEditionV1( - rawAccount: RpcAccount -): MasterEditionV1; -export function deserializeMasterEditionV1( - context: RpcAccount | object, - rawAccount?: RpcAccount -): MasterEditionV1 { - return deserializeAccount( - rawAccount ?? (context as RpcAccount), - getMasterEditionV1AccountDataSerializer() - ); -} - -export async function fetchMasterEditionV1( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions -): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'MasterEditionV1'); - return deserializeMasterEditionV1(maybeAccount); -} - -export async function safeFetchMasterEditionV1( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions -): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists ? deserializeMasterEditionV1(maybeAccount) : null; -} - -export async function fetchAllMasterEditionV1( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions -): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'MasterEditionV1'); - return deserializeMasterEditionV1(maybeAccount); - }); -} - -export async function safeFetchAllMasterEditionV1( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions -): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => - deserializeMasterEditionV1(maybeAccount as RpcAccount) - ); -} - -export function getMasterEditionV1GpaBuilder( - context: Pick -) { - const programId = context.programs.getPublicKey( - 'tokenMetadata', - 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' - ); - return gpaBuilder(context, programId) - .registerFields<{ - key: KeyArgs; - supply: number | bigint; - maxSupply: OptionOrNullable; - printingMint: PublicKey; - oneTimePrintingAuthorizationMint: PublicKey; - }>({ - key: [0, getKeySerializer()], - supply: [1, u64()], - maxSupply: [9, option(u64())], - printingMint: [null, publicKeySerializer()], - oneTimePrintingAuthorizationMint: [null, publicKeySerializer()], - }) - .deserializeUsing((account) => - deserializeMasterEditionV1(account) - ); -} diff --git a/clients/js/src/generated/accounts/metadata.ts b/clients/js/src/generated/accounts/metadata.ts index e79cd110..57719a6f 100644 --- a/clients/js/src/generated/accounts/metadata.ts +++ b/clients/js/src/generated/accounts/metadata.ts @@ -207,7 +207,7 @@ export function getMetadataGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -262,7 +262,7 @@ export function findMetadataPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/metadataDelegateRecord.ts b/clients/js/src/generated/accounts/metadataDelegateRecord.ts index 41707439..c4553253 100644 --- a/clients/js/src/generated/accounts/metadataDelegateRecord.ts +++ b/clients/js/src/generated/accounts/metadataDelegateRecord.ts @@ -162,7 +162,7 @@ export function getMetadataDelegateRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -202,7 +202,7 @@ export function findMetadataDelegateRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/reservationListV1.ts b/clients/js/src/generated/accounts/reservationListV1.ts deleted file mode 100644 index 31981255..00000000 --- a/clients/js/src/generated/accounts/reservationListV1.ts +++ /dev/null @@ -1,180 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { - Account, - Context, - Option, - OptionOrNullable, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; -import { - Serializer, - array, - option, - publicKey as publicKeySerializer, - struct, - u64, -} from '@metaplex-foundation/umi/serializers'; -import { - Key, - KeyArgs, - ReservationV1, - ReservationV1Args, - getKeySerializer, - getReservationV1Serializer, -} from '../types'; - -export type ReservationListV1 = Account; - -export type ReservationListV1AccountData = { - key: Key; - masterEdition: PublicKey; - supplySnapshot: Option; - reservations: Array; -}; - -export type ReservationListV1AccountDataArgs = { - key: KeyArgs; - masterEdition: PublicKey; - supplySnapshot: OptionOrNullable; - reservations: Array; -}; - -/** @deprecated Use `getReservationListV1AccountDataSerializer()` without any argument instead. */ -export function getReservationListV1AccountDataSerializer( - _context: object -): Serializer; -export function getReservationListV1AccountDataSerializer(): Serializer< - ReservationListV1AccountDataArgs, - ReservationListV1AccountData ->; -export function getReservationListV1AccountDataSerializer( - _context: object = {} -): Serializer { - return struct( - [ - ['key', getKeySerializer()], - ['masterEdition', publicKeySerializer()], - ['supplySnapshot', option(u64())], - ['reservations', array(getReservationV1Serializer())], - ], - { description: 'ReservationListV1AccountData' } - ) as Serializer< - ReservationListV1AccountDataArgs, - ReservationListV1AccountData - >; -} - -/** @deprecated Use `deserializeReservationListV1(rawAccount)` without any context instead. */ -export function deserializeReservationListV1( - context: object, - rawAccount: RpcAccount -): ReservationListV1; -export function deserializeReservationListV1( - rawAccount: RpcAccount -): ReservationListV1; -export function deserializeReservationListV1( - context: RpcAccount | object, - rawAccount?: RpcAccount -): ReservationListV1 { - return deserializeAccount( - rawAccount ?? (context as RpcAccount), - getReservationListV1AccountDataSerializer() - ); -} - -export async function fetchReservationListV1( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions -): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'ReservationListV1'); - return deserializeReservationListV1(maybeAccount); -} - -export async function safeFetchReservationListV1( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions -): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists - ? deserializeReservationListV1(maybeAccount) - : null; -} - -export async function fetchAllReservationListV1( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions -): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'ReservationListV1'); - return deserializeReservationListV1(maybeAccount); - }); -} - -export async function safeFetchAllReservationListV1( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions -): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => - deserializeReservationListV1(maybeAccount as RpcAccount) - ); -} - -export function getReservationListV1GpaBuilder( - context: Pick -) { - const programId = context.programs.getPublicKey( - 'tokenMetadata', - 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' - ); - return gpaBuilder(context, programId) - .registerFields<{ - key: KeyArgs; - masterEdition: PublicKey; - supplySnapshot: OptionOrNullable; - reservations: Array; - }>({ - key: [0, getKeySerializer()], - masterEdition: [1, publicKeySerializer()], - supplySnapshot: [33, option(u64())], - reservations: [null, array(getReservationV1Serializer())], - }) - .deserializeUsing((account) => - deserializeReservationListV1(account) - ); -} diff --git a/clients/js/src/generated/accounts/reservationListV2.ts b/clients/js/src/generated/accounts/reservationListV2.ts deleted file mode 100644 index 74cdc3a1..00000000 --- a/clients/js/src/generated/accounts/reservationListV2.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { - Account, - Context, - Option, - OptionOrNullable, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; -import { - Serializer, - array, - option, - publicKey as publicKeySerializer, - struct, - u64, -} from '@metaplex-foundation/umi/serializers'; -import { - Key, - KeyArgs, - Reservation, - ReservationArgs, - getKeySerializer, - getReservationSerializer, -} from '../types'; - -export type ReservationListV2 = Account; - -export type ReservationListV2AccountData = { - key: Key; - masterEdition: PublicKey; - supplySnapshot: Option; - reservations: Array; - totalReservationSpots: bigint; - currentReservationSpots: bigint; -}; - -export type ReservationListV2AccountDataArgs = { - key: KeyArgs; - masterEdition: PublicKey; - supplySnapshot: OptionOrNullable; - reservations: Array; - totalReservationSpots: number | bigint; - currentReservationSpots: number | bigint; -}; - -/** @deprecated Use `getReservationListV2AccountDataSerializer()` without any argument instead. */ -export function getReservationListV2AccountDataSerializer( - _context: object -): Serializer; -export function getReservationListV2AccountDataSerializer(): Serializer< - ReservationListV2AccountDataArgs, - ReservationListV2AccountData ->; -export function getReservationListV2AccountDataSerializer( - _context: object = {} -): Serializer { - return struct( - [ - ['key', getKeySerializer()], - ['masterEdition', publicKeySerializer()], - ['supplySnapshot', option(u64())], - ['reservations', array(getReservationSerializer())], - ['totalReservationSpots', u64()], - ['currentReservationSpots', u64()], - ], - { description: 'ReservationListV2AccountData' } - ) as Serializer< - ReservationListV2AccountDataArgs, - ReservationListV2AccountData - >; -} - -/** @deprecated Use `deserializeReservationListV2(rawAccount)` without any context instead. */ -export function deserializeReservationListV2( - context: object, - rawAccount: RpcAccount -): ReservationListV2; -export function deserializeReservationListV2( - rawAccount: RpcAccount -): ReservationListV2; -export function deserializeReservationListV2( - context: RpcAccount | object, - rawAccount?: RpcAccount -): ReservationListV2 { - return deserializeAccount( - rawAccount ?? (context as RpcAccount), - getReservationListV2AccountDataSerializer() - ); -} - -export async function fetchReservationListV2( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions -): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'ReservationListV2'); - return deserializeReservationListV2(maybeAccount); -} - -export async function safeFetchReservationListV2( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions -): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists - ? deserializeReservationListV2(maybeAccount) - : null; -} - -export async function fetchAllReservationListV2( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions -): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'ReservationListV2'); - return deserializeReservationListV2(maybeAccount); - }); -} - -export async function safeFetchAllReservationListV2( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions -): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => - deserializeReservationListV2(maybeAccount as RpcAccount) - ); -} - -export function getReservationListV2GpaBuilder( - context: Pick -) { - const programId = context.programs.getPublicKey( - 'tokenMetadata', - 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' - ); - return gpaBuilder(context, programId) - .registerFields<{ - key: KeyArgs; - masterEdition: PublicKey; - supplySnapshot: OptionOrNullable; - reservations: Array; - totalReservationSpots: number | bigint; - currentReservationSpots: number | bigint; - }>({ - key: [0, getKeySerializer()], - masterEdition: [1, publicKeySerializer()], - supplySnapshot: [33, option(u64())], - reservations: [null, array(getReservationSerializer())], - totalReservationSpots: [null, u64()], - currentReservationSpots: [null, u64()], - }) - .deserializeUsing((account) => - deserializeReservationListV2(account) - ); -} diff --git a/clients/js/src/generated/accounts/tokenOwnedEscrow.ts b/clients/js/src/generated/accounts/tokenOwnedEscrow.ts index 95791f4e..eef9f00f 100644 --- a/clients/js/src/generated/accounts/tokenOwnedEscrow.ts +++ b/clients/js/src/generated/accounts/tokenOwnedEscrow.ts @@ -157,7 +157,7 @@ export function getTokenOwnedEscrowGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/tokenRecord.ts b/clients/js/src/generated/accounts/tokenRecord.ts index f9a641e9..294405f8 100644 --- a/clients/js/src/generated/accounts/tokenRecord.ts +++ b/clients/js/src/generated/accounts/tokenRecord.ts @@ -166,7 +166,7 @@ export function getTokenRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -205,7 +205,7 @@ export function findTokenRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/useAuthorityRecord.ts b/clients/js/src/generated/accounts/useAuthorityRecord.ts index 7a3fb4ab..0814edb3 100644 --- a/clients/js/src/generated/accounts/useAuthorityRecord.ts +++ b/clients/js/src/generated/accounts/useAuthorityRecord.ts @@ -157,7 +157,7 @@ export function getUseAuthorityRecordGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return gpaBuilder(context, programId) @@ -190,7 +190,7 @@ export function findUseAuthorityRecordPda( } ): Pda { const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/errors/index.ts b/clients/js/src/generated/errors/index.ts index cbfa4bd8..40440497 100644 --- a/clients/js/src/generated/errors/index.ts +++ b/clients/js/src/generated/errors/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './tokenMetadata'; +export * from './mplTokenMetadata'; diff --git a/clients/js/src/generated/errors/tokenMetadata.ts b/clients/js/src/generated/errors/mplTokenMetadata.ts similarity index 99% rename from clients/js/src/generated/errors/tokenMetadata.ts rename to clients/js/src/generated/errors/mplTokenMetadata.ts index 15b36ac2..ed040264 100644 --- a/clients/js/src/generated/errors/tokenMetadata.ts +++ b/clients/js/src/generated/errors/mplTokenMetadata.ts @@ -2841,7 +2841,7 @@ nameToErrorMap.set('InvalidMetadataFlags', InvalidMetadataFlagsError); * Attempts to resolve a custom program error from the provided error code. * @category Errors */ -export function getTokenMetadataErrorFromCode( +export function getMplTokenMetadataErrorFromCode( code: number, program: Program, cause?: Error @@ -2854,7 +2854,7 @@ export function getTokenMetadataErrorFromCode( * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors */ -export function getTokenMetadataErrorFromName( +export function getMplTokenMetadataErrorFromName( name: string, program: Program, cause?: Error diff --git a/clients/js/src/generated/instructions/approveCollectionAuthority.ts b/clients/js/src/generated/instructions/approveCollectionAuthority.ts index a47c1329..f3c5d5d4 100644 --- a/clients/js/src/generated/instructions/approveCollectionAuthority.ts +++ b/clients/js/src/generated/instructions/approveCollectionAuthority.ts @@ -95,7 +95,7 @@ export function approveCollectionAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/approveUseAuthority.ts b/clients/js/src/generated/instructions/approveUseAuthority.ts index 34b6713c..86befd50 100644 --- a/clients/js/src/generated/instructions/approveUseAuthority.ts +++ b/clients/js/src/generated/instructions/approveUseAuthority.ts @@ -113,7 +113,7 @@ export function approveUseAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts index 99dcdcf3..07cbc52e 100644 --- a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts +++ b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts @@ -103,7 +103,7 @@ export function bubblegumSetCollectionSize( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/burnEditionNft.ts b/clients/js/src/generated/instructions/burnEditionNft.ts index 9d2195e5..46581d61 100644 --- a/clients/js/src/generated/instructions/burnEditionNft.ts +++ b/clients/js/src/generated/instructions/burnEditionNft.ts @@ -91,7 +91,7 @@ export function burnEditionNft( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/burnNft.ts b/clients/js/src/generated/instructions/burnNft.ts index 303150bd..de731796 100644 --- a/clients/js/src/generated/instructions/burnNft.ts +++ b/clients/js/src/generated/instructions/burnNft.ts @@ -77,7 +77,7 @@ export function burnNft( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/burnV1.ts b/clients/js/src/generated/instructions/burnV1.ts index 7ef31404..c1560fb1 100644 --- a/clients/js/src/generated/instructions/burnV1.ts +++ b/clients/js/src/generated/instructions/burnV1.ts @@ -125,7 +125,7 @@ export function burnV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/closeEscrowAccount.ts b/clients/js/src/generated/instructions/closeEscrowAccount.ts index 451c0ab1..b9b9d523 100644 --- a/clients/js/src/generated/instructions/closeEscrowAccount.ts +++ b/clients/js/src/generated/instructions/closeEscrowAccount.ts @@ -92,7 +92,7 @@ export function closeEscrowAccount( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/collect.ts b/clients/js/src/generated/instructions/collect.ts index 7c916325..a1b1c87d 100644 --- a/clients/js/src/generated/instructions/collect.ts +++ b/clients/js/src/generated/instructions/collect.ts @@ -65,7 +65,7 @@ export function collect( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts b/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts index b319e1ea..13d11640 100644 --- a/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts +++ b/clients/js/src/generated/instructions/convertMasterEditionV1ToV2.ts @@ -83,7 +83,7 @@ export function convertMasterEditionV1ToV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createEscrowAccount.ts b/clients/js/src/generated/instructions/createEscrowAccount.ts index b196db29..c5246aa5 100644 --- a/clients/js/src/generated/instructions/createEscrowAccount.ts +++ b/clients/js/src/generated/instructions/createEscrowAccount.ts @@ -94,7 +94,7 @@ export function createEscrowAccount( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createMasterEditionV3.ts b/clients/js/src/generated/instructions/createMasterEditionV3.ts index acb56add..154023ea 100644 --- a/clients/js/src/generated/instructions/createMasterEditionV3.ts +++ b/clients/js/src/generated/instructions/createMasterEditionV3.ts @@ -112,7 +112,7 @@ export function createMasterEditionV3( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createMetadataAccountV3.ts b/clients/js/src/generated/instructions/createMetadataAccountV3.ts index 9cc67169..8f4e2198 100644 --- a/clients/js/src/generated/instructions/createMetadataAccountV3.ts +++ b/clients/js/src/generated/instructions/createMetadataAccountV3.ts @@ -122,7 +122,7 @@ export function createMetadataAccountV3( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/createV1.ts b/clients/js/src/generated/instructions/createV1.ts index c2b64470..40368f7f 100644 --- a/clients/js/src/generated/instructions/createV1.ts +++ b/clients/js/src/generated/instructions/createV1.ts @@ -201,7 +201,7 @@ export function createV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts b/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts index 41670d90..132bfa70 100644 --- a/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts +++ b/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts @@ -150,7 +150,7 @@ export function delegateAuthorityItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateCollectionItemV1.ts b/clients/js/src/generated/instructions/delegateCollectionItemV1.ts index 769829e6..fceb304d 100644 --- a/clients/js/src/generated/instructions/delegateCollectionItemV1.ts +++ b/clients/js/src/generated/instructions/delegateCollectionItemV1.ts @@ -150,7 +150,7 @@ export function delegateCollectionItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateCollectionV1.ts b/clients/js/src/generated/instructions/delegateCollectionV1.ts index 7b986a52..35de1072 100644 --- a/clients/js/src/generated/instructions/delegateCollectionV1.ts +++ b/clients/js/src/generated/instructions/delegateCollectionV1.ts @@ -150,7 +150,7 @@ export function delegateCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateDataItemV1.ts b/clients/js/src/generated/instructions/delegateDataItemV1.ts index bcab90cf..f455e3a4 100644 --- a/clients/js/src/generated/instructions/delegateDataItemV1.ts +++ b/clients/js/src/generated/instructions/delegateDataItemV1.ts @@ -150,7 +150,7 @@ export function delegateDataItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateDataV1.ts b/clients/js/src/generated/instructions/delegateDataV1.ts index 6c95930d..eaa04cac 100644 --- a/clients/js/src/generated/instructions/delegateDataV1.ts +++ b/clients/js/src/generated/instructions/delegateDataV1.ts @@ -145,7 +145,7 @@ export function delegateDataV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateLockedTransferV1.ts b/clients/js/src/generated/instructions/delegateLockedTransferV1.ts index 4e5b6680..1d4b7231 100644 --- a/clients/js/src/generated/instructions/delegateLockedTransferV1.ts +++ b/clients/js/src/generated/instructions/delegateLockedTransferV1.ts @@ -159,7 +159,7 @@ export function delegateLockedTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts b/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts index a54bf67a..3e18d614 100644 --- a/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts +++ b/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts @@ -150,7 +150,7 @@ export function delegateProgrammableConfigItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts b/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts index d664f377..1d99f695 100644 --- a/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts +++ b/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts @@ -150,7 +150,7 @@ export function delegateProgrammableConfigV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateSaleV1.ts b/clients/js/src/generated/instructions/delegateSaleV1.ts index 4984f978..794989b2 100644 --- a/clients/js/src/generated/instructions/delegateSaleV1.ts +++ b/clients/js/src/generated/instructions/delegateSaleV1.ts @@ -150,7 +150,7 @@ export function delegateSaleV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateStakingV1.ts b/clients/js/src/generated/instructions/delegateStakingV1.ts index 6030bd1b..37ae3dcc 100644 --- a/clients/js/src/generated/instructions/delegateStakingV1.ts +++ b/clients/js/src/generated/instructions/delegateStakingV1.ts @@ -153,7 +153,7 @@ export function delegateStakingV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateStandardV1.ts b/clients/js/src/generated/instructions/delegateStandardV1.ts index e2403c64..f219f569 100644 --- a/clients/js/src/generated/instructions/delegateStandardV1.ts +++ b/clients/js/src/generated/instructions/delegateStandardV1.ts @@ -141,7 +141,7 @@ export function delegateStandardV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateTransferV1.ts b/clients/js/src/generated/instructions/delegateTransferV1.ts index b80f7f23..04ead297 100644 --- a/clients/js/src/generated/instructions/delegateTransferV1.ts +++ b/clients/js/src/generated/instructions/delegateTransferV1.ts @@ -155,7 +155,7 @@ export function delegateTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/delegateUtilityV1.ts b/clients/js/src/generated/instructions/delegateUtilityV1.ts index 7e964ac0..c79c537d 100644 --- a/clients/js/src/generated/instructions/delegateUtilityV1.ts +++ b/clients/js/src/generated/instructions/delegateUtilityV1.ts @@ -153,7 +153,7 @@ export function delegateUtilityV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts index 7d74e694..3204d5af 100644 --- a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts +++ b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts @@ -115,7 +115,7 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/freezeDelegatedAccount.ts b/clients/js/src/generated/instructions/freezeDelegatedAccount.ts index d9bae93f..602e08b0 100644 --- a/clients/js/src/generated/instructions/freezeDelegatedAccount.ts +++ b/clients/js/src/generated/instructions/freezeDelegatedAccount.ts @@ -86,7 +86,7 @@ export function freezeDelegatedAccount( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/lockV1.ts b/clients/js/src/generated/instructions/lockV1.ts index ecd7b32d..ed56b2ae 100644 --- a/clients/js/src/generated/instructions/lockV1.ts +++ b/clients/js/src/generated/instructions/lockV1.ts @@ -130,7 +130,7 @@ export function lockV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/migrate.ts b/clients/js/src/generated/instructions/migrate.ts index 5b07a8d1..a642819a 100644 --- a/clients/js/src/generated/instructions/migrate.ts +++ b/clients/js/src/generated/instructions/migrate.ts @@ -98,7 +98,7 @@ export function migrate( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts index 933168b3..1f1cf719 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts @@ -124,7 +124,7 @@ export function mintNewEditionFromMasterEditionViaToken( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts index 6a8b73f9..37ddf9b4 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts @@ -133,7 +133,7 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/mintV1.ts b/clients/js/src/generated/instructions/mintV1.ts index cd4ccf0c..6f7083d5 100644 --- a/clients/js/src/generated/instructions/mintV1.ts +++ b/clients/js/src/generated/instructions/mintV1.ts @@ -138,7 +138,7 @@ export function mintV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/printV1.ts b/clients/js/src/generated/instructions/printV1.ts index 9220c478..873cff40 100644 --- a/clients/js/src/generated/instructions/printV1.ts +++ b/clients/js/src/generated/instructions/printV1.ts @@ -112,7 +112,7 @@ export function printV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/puffMetadata.ts b/clients/js/src/generated/instructions/puffMetadata.ts index e026d8c9..1a67127e 100644 --- a/clients/js/src/generated/instructions/puffMetadata.ts +++ b/clients/js/src/generated/instructions/puffMetadata.ts @@ -67,7 +67,7 @@ export function puffMetadata( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/removeCreatorVerification.ts b/clients/js/src/generated/instructions/removeCreatorVerification.ts index 4db12289..b02872ea 100644 --- a/clients/js/src/generated/instructions/removeCreatorVerification.ts +++ b/clients/js/src/generated/instructions/removeCreatorVerification.ts @@ -81,7 +81,7 @@ export function removeCreatorVerification( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts b/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts index 3624df82..e17ef813 100644 --- a/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts +++ b/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts @@ -134,7 +134,7 @@ export function revokeAuthorityItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeCollectionAuthority.ts b/clients/js/src/generated/instructions/revokeCollectionAuthority.ts index a4607429..0a3ce571 100644 --- a/clients/js/src/generated/instructions/revokeCollectionAuthority.ts +++ b/clients/js/src/generated/instructions/revokeCollectionAuthority.ts @@ -89,7 +89,7 @@ export function revokeCollectionAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeCollectionItemV1.ts b/clients/js/src/generated/instructions/revokeCollectionItemV1.ts index 50d06d71..7f4008fd 100644 --- a/clients/js/src/generated/instructions/revokeCollectionItemV1.ts +++ b/clients/js/src/generated/instructions/revokeCollectionItemV1.ts @@ -134,7 +134,7 @@ export function revokeCollectionItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeCollectionV1.ts b/clients/js/src/generated/instructions/revokeCollectionV1.ts index 916544f5..636d6f0b 100644 --- a/clients/js/src/generated/instructions/revokeCollectionV1.ts +++ b/clients/js/src/generated/instructions/revokeCollectionV1.ts @@ -134,7 +134,7 @@ export function revokeCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeDataItemV1.ts b/clients/js/src/generated/instructions/revokeDataItemV1.ts index a7132d91..f7fc44f0 100644 --- a/clients/js/src/generated/instructions/revokeDataItemV1.ts +++ b/clients/js/src/generated/instructions/revokeDataItemV1.ts @@ -133,7 +133,7 @@ export function revokeDataItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeDataV1.ts b/clients/js/src/generated/instructions/revokeDataV1.ts index 9fb5ff8c..37fef570 100644 --- a/clients/js/src/generated/instructions/revokeDataV1.ts +++ b/clients/js/src/generated/instructions/revokeDataV1.ts @@ -120,7 +120,7 @@ export function revokeDataV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeLockedTransferV1.ts b/clients/js/src/generated/instructions/revokeLockedTransferV1.ts index 174951c8..09d946c4 100644 --- a/clients/js/src/generated/instructions/revokeLockedTransferV1.ts +++ b/clients/js/src/generated/instructions/revokeLockedTransferV1.ts @@ -135,7 +135,7 @@ export function revokeLockedTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeMigrationV1.ts b/clients/js/src/generated/instructions/revokeMigrationV1.ts index cc118d27..37b0352c 100644 --- a/clients/js/src/generated/instructions/revokeMigrationV1.ts +++ b/clients/js/src/generated/instructions/revokeMigrationV1.ts @@ -134,7 +134,7 @@ export function revokeMigrationV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts b/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts index f275a73d..9ca969a3 100644 --- a/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts +++ b/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts @@ -134,7 +134,7 @@ export function revokeProgrammableConfigItemV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts b/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts index d8b7325c..4f2e6554 100644 --- a/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts +++ b/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts @@ -134,7 +134,7 @@ export function revokeProgrammableConfigV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeSaleV1.ts b/clients/js/src/generated/instructions/revokeSaleV1.ts index 1926ee38..46d00983 100644 --- a/clients/js/src/generated/instructions/revokeSaleV1.ts +++ b/clients/js/src/generated/instructions/revokeSaleV1.ts @@ -121,7 +121,7 @@ export function revokeSaleV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeStakingV1.ts b/clients/js/src/generated/instructions/revokeStakingV1.ts index 6ad4be04..d39bbc13 100644 --- a/clients/js/src/generated/instructions/revokeStakingV1.ts +++ b/clients/js/src/generated/instructions/revokeStakingV1.ts @@ -134,7 +134,7 @@ export function revokeStakingV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeStandardV1.ts b/clients/js/src/generated/instructions/revokeStandardV1.ts index ed715d6e..2aa045cd 100644 --- a/clients/js/src/generated/instructions/revokeStandardV1.ts +++ b/clients/js/src/generated/instructions/revokeStandardV1.ts @@ -133,7 +133,7 @@ export function revokeStandardV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeTransferV1.ts b/clients/js/src/generated/instructions/revokeTransferV1.ts index 43df14df..8f5aeca6 100644 --- a/clients/js/src/generated/instructions/revokeTransferV1.ts +++ b/clients/js/src/generated/instructions/revokeTransferV1.ts @@ -134,7 +134,7 @@ export function revokeTransferV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeUseAuthority.ts b/clients/js/src/generated/instructions/revokeUseAuthority.ts index 2df16755..01d44a8d 100644 --- a/clients/js/src/generated/instructions/revokeUseAuthority.ts +++ b/clients/js/src/generated/instructions/revokeUseAuthority.ts @@ -94,7 +94,7 @@ export function revokeUseAuthority( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/revokeUtilityV1.ts b/clients/js/src/generated/instructions/revokeUtilityV1.ts index 15511a26..349f48ee 100644 --- a/clients/js/src/generated/instructions/revokeUtilityV1.ts +++ b/clients/js/src/generated/instructions/revokeUtilityV1.ts @@ -134,7 +134,7 @@ export function revokeUtilityV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setAndVerifyCollection.ts b/clients/js/src/generated/instructions/setAndVerifyCollection.ts index 2d54c2f3..c88c2cdc 100644 --- a/clients/js/src/generated/instructions/setAndVerifyCollection.ts +++ b/clients/js/src/generated/instructions/setAndVerifyCollection.ts @@ -90,7 +90,7 @@ export function setAndVerifyCollection( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts index 817669ac..97e21082 100644 --- a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts @@ -93,7 +93,7 @@ export function setAndVerifySizedCollectionItem( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setCollectionSize.ts b/clients/js/src/generated/instructions/setCollectionSize.ts index bab31a61..d14de9b7 100644 --- a/clients/js/src/generated/instructions/setCollectionSize.ts +++ b/clients/js/src/generated/instructions/setCollectionSize.ts @@ -100,7 +100,7 @@ export function setCollectionSize( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/setTokenStandard.ts b/clients/js/src/generated/instructions/setTokenStandard.ts index 276d3620..cd5952dd 100644 --- a/clients/js/src/generated/instructions/setTokenStandard.ts +++ b/clients/js/src/generated/instructions/setTokenStandard.ts @@ -84,7 +84,7 @@ export function setTokenStandard( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/signMetadata.ts b/clients/js/src/generated/instructions/signMetadata.ts index bee1dcc7..ffe28823 100644 --- a/clients/js/src/generated/instructions/signMetadata.ts +++ b/clients/js/src/generated/instructions/signMetadata.ts @@ -69,7 +69,7 @@ export function signMetadata( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/thawDelegatedAccount.ts b/clients/js/src/generated/instructions/thawDelegatedAccount.ts index 074ccade..a9244a05 100644 --- a/clients/js/src/generated/instructions/thawDelegatedAccount.ts +++ b/clients/js/src/generated/instructions/thawDelegatedAccount.ts @@ -86,7 +86,7 @@ export function thawDelegatedAccount( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/transferOutOfEscrow.ts b/clients/js/src/generated/instructions/transferOutOfEscrow.ts index 146d7701..81fe6817 100644 --- a/clients/js/src/generated/instructions/transferOutOfEscrow.ts +++ b/clients/js/src/generated/instructions/transferOutOfEscrow.ts @@ -116,7 +116,7 @@ export function transferOutOfEscrow( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/transferV1.ts b/clients/js/src/generated/instructions/transferV1.ts index 5d7f2d68..79a8cdf3 100644 --- a/clients/js/src/generated/instructions/transferV1.ts +++ b/clients/js/src/generated/instructions/transferV1.ts @@ -148,7 +148,7 @@ export function transferV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unlockV1.ts b/clients/js/src/generated/instructions/unlockV1.ts index 4c570cfb..9bcd13b2 100644 --- a/clients/js/src/generated/instructions/unlockV1.ts +++ b/clients/js/src/generated/instructions/unlockV1.ts @@ -134,7 +134,7 @@ export function unlockV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifyCollection.ts b/clients/js/src/generated/instructions/unverifyCollection.ts index b9623953..64cff44e 100644 --- a/clients/js/src/generated/instructions/unverifyCollection.ts +++ b/clients/js/src/generated/instructions/unverifyCollection.ts @@ -86,7 +86,7 @@ export function unverifyCollection( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifyCollectionV1.ts b/clients/js/src/generated/instructions/unverifyCollectionV1.ts index 005e4481..4a7e4c98 100644 --- a/clients/js/src/generated/instructions/unverifyCollectionV1.ts +++ b/clients/js/src/generated/instructions/unverifyCollectionV1.ts @@ -101,7 +101,7 @@ export function unverifyCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifyCreatorV1.ts b/clients/js/src/generated/instructions/unverifyCreatorV1.ts index 449eaa5e..24bafd93 100644 --- a/clients/js/src/generated/instructions/unverifyCreatorV1.ts +++ b/clients/js/src/generated/instructions/unverifyCreatorV1.ts @@ -100,7 +100,7 @@ export function unverifyCreatorV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts index 3456023c..17501bb7 100644 --- a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts @@ -91,7 +91,7 @@ export function unverifySizedCollectionItem( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts index d8722d9c..c8da3be4 100644 --- a/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts @@ -159,7 +159,7 @@ export function updateAsAuthorityItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts b/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts index 4d86f67e..c3ed0e57 100644 --- a/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsCollectionDelegateV2.ts @@ -147,7 +147,7 @@ export function updateAsCollectionDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts index 90c2dc4d..8445a34c 100644 --- a/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts @@ -146,7 +146,7 @@ export function updateAsCollectionItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts b/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts index 0acae41c..73d64dfa 100644 --- a/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsDataDelegateV2.ts @@ -172,7 +172,7 @@ export function updateAsDataDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts index 06d5a59d..7646199b 100644 --- a/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts @@ -171,7 +171,7 @@ export function updateAsDataItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts b/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts index 888feb9f..564e1fb2 100644 --- a/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsProgrammableConfigDelegateV2.ts @@ -147,7 +147,7 @@ export function updateAsProgrammableConfigDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts index a2af483f..990eef4a 100644 --- a/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts @@ -147,7 +147,7 @@ export function updateAsProgrammableConfigItemDelegateV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts b/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts index 685c2843..c3688e82 100644 --- a/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts +++ b/clients/js/src/generated/instructions/updateAsUpdateAuthorityV2.ts @@ -216,7 +216,7 @@ export function updateAsUpdateAuthorityV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateMetadataAccountV2.ts b/clients/js/src/generated/instructions/updateMetadataAccountV2.ts index d6f019c0..fb7db8de 100644 --- a/clients/js/src/generated/instructions/updateMetadataAccountV2.ts +++ b/clients/js/src/generated/instructions/updateMetadataAccountV2.ts @@ -115,7 +115,7 @@ export function updateMetadataAccountV2( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts b/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts index f7e96f95..b5c74ed6 100644 --- a/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts +++ b/clients/js/src/generated/instructions/updatePrimarySaleHappenedViaToken.ts @@ -83,7 +83,7 @@ export function updatePrimarySaleHappenedViaToken( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/updateV1.ts b/clients/js/src/generated/instructions/updateV1.ts index 9be03008..8e066eb4 100644 --- a/clients/js/src/generated/instructions/updateV1.ts +++ b/clients/js/src/generated/instructions/updateV1.ts @@ -198,7 +198,7 @@ export function updateV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/useV1.ts b/clients/js/src/generated/instructions/useV1.ts index 7870f53c..be0bc2d4 100644 --- a/clients/js/src/generated/instructions/useV1.ts +++ b/clients/js/src/generated/instructions/useV1.ts @@ -116,7 +116,7 @@ export function useV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/utilize.ts b/clients/js/src/generated/instructions/utilize.ts index 27f059fd..d860e579 100644 --- a/clients/js/src/generated/instructions/utilize.ts +++ b/clients/js/src/generated/instructions/utilize.ts @@ -96,7 +96,7 @@ export function utilize( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifyCollection.ts b/clients/js/src/generated/instructions/verifyCollection.ts index 8a0d5a44..eb522b93 100644 --- a/clients/js/src/generated/instructions/verifyCollection.ts +++ b/clients/js/src/generated/instructions/verifyCollection.ts @@ -88,7 +88,7 @@ export function verifyCollection( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifyCollectionV1.ts b/clients/js/src/generated/instructions/verifyCollectionV1.ts index a929fc88..08b04d23 100644 --- a/clients/js/src/generated/instructions/verifyCollectionV1.ts +++ b/clients/js/src/generated/instructions/verifyCollectionV1.ts @@ -103,7 +103,7 @@ export function verifyCollectionV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifyCreatorV1.ts b/clients/js/src/generated/instructions/verifyCreatorV1.ts index 731f0bfb..3ad89d48 100644 --- a/clients/js/src/generated/instructions/verifyCreatorV1.ts +++ b/clients/js/src/generated/instructions/verifyCreatorV1.ts @@ -102,7 +102,7 @@ export function verifyCreatorV1( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts index 85e1d4d8..f1248441 100644 --- a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts @@ -91,7 +91,7 @@ export function verifySizedCollectionItem( // Program ID. const programId = context.programs.getPublicKey( - 'tokenMetadata', + 'mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' ); diff --git a/clients/js/src/generated/programs/index.ts b/clients/js/src/generated/programs/index.ts index cbfa4bd8..40440497 100644 --- a/clients/js/src/generated/programs/index.ts +++ b/clients/js/src/generated/programs/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './tokenMetadata'; +export * from './mplTokenMetadata'; diff --git a/clients/js/src/generated/programs/tokenMetadata.ts b/clients/js/src/generated/programs/mplTokenMetadata.ts similarity index 58% rename from clients/js/src/generated/programs/tokenMetadata.ts rename to clients/js/src/generated/programs/mplTokenMetadata.ts index e68dedd6..c2335d5c 100644 --- a/clients/js/src/generated/programs/tokenMetadata.ts +++ b/clients/js/src/generated/programs/mplTokenMetadata.ts @@ -13,22 +13,22 @@ import { PublicKey, } from '@metaplex-foundation/umi'; import { - getTokenMetadataErrorFromCode, - getTokenMetadataErrorFromName, + getMplTokenMetadataErrorFromCode, + getMplTokenMetadataErrorFromName, } from '../errors'; -export const TOKEN_METADATA_PROGRAM_ID = +export const MPL_TOKEN_METADATA_PROGRAM_ID = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' as PublicKey<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'>; -export function createTokenMetadataProgram(): Program { +export function createMplTokenMetadataProgram(): Program { return { - name: 'tokenMetadata', - publicKey: TOKEN_METADATA_PROGRAM_ID, + name: 'mplTokenMetadata', + publicKey: MPL_TOKEN_METADATA_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { - return getTokenMetadataErrorFromCode(code, this, cause); + return getMplTokenMetadataErrorFromCode(code, this, cause); }, getErrorFromName(name: string, cause?: Error) { - return getTokenMetadataErrorFromName(name, this, cause); + return getMplTokenMetadataErrorFromName(name, this, cause); }, isOnCluster() { return true; @@ -36,20 +36,20 @@ export function createTokenMetadataProgram(): Program { }; } -export function getTokenMetadataProgram( +export function getMplTokenMetadataProgram( context: Pick, clusterFilter?: ClusterFilter ): T { - return context.programs.get('tokenMetadata', clusterFilter); + return context.programs.get('mplTokenMetadata', clusterFilter); } -export function getTokenMetadataProgramId( +export function getMplTokenMetadataProgramId( context: Pick, clusterFilter?: ClusterFilter ): PublicKey { return context.programs.getPublicKey( - 'tokenMetadata', - TOKEN_METADATA_PROGRAM_ID, + 'mplTokenMetadata', + MPL_TOKEN_METADATA_PROGRAM_ID, clusterFilter ); } diff --git a/clients/js/src/plugin.ts b/clients/js/src/plugin.ts index 382f75e8..b2fdc0f8 100644 --- a/clients/js/src/plugin.ts +++ b/clients/js/src/plugin.ts @@ -1,10 +1,10 @@ import { UmiPlugin } from '@metaplex-foundation/umi'; import { mplToolbox } from '@metaplex-foundation/mpl-toolbox'; -import { createTokenMetadataProgram } from './generated'; +import { createMplTokenMetadataProgram } from './generated'; export const mplTokenMetadata = (): UmiPlugin => ({ install(umi) { umi.use(mplToolbox()); - umi.programs.add(createTokenMetadataProgram(), false); + umi.programs.add(createMplTokenMetadataProgram(), false); }, }); diff --git a/clients/rust/Cargo.lock b/clients/rust/Cargo.lock index 1e3c5d48..b82c26d5 100644 --- a/clients/rust/Cargo.lock +++ b/clients/rust/Cargo.lock @@ -2061,8 +2061,8 @@ dependencies = [ ] [[package]] -name = "mpl-token-metadata-sdk" -version = "0.0.1" +name = "mpl-token-metadata" +version = "2.0.0-beta.1" dependencies = [ "assert_matches", "borsh 0.10.3", @@ -2386,7 +2386,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -3261,9 +3261,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3fd71c1b3a1bd76840b627a85e0580dc85a5db59259d6f2129eb4bea8ff628" +checksum = "c387acc1a8ce38f65fe35690a5afd16f0d4c943067cf2db133e7120a38a1c423" dependencies = [ "Inflector", "base64 0.21.2", @@ -3285,9 +3285,9 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147c6ac17124380edf2e5a505da0e2c22ad300c3b532cad4497a6da3a9bc54dc" +checksum = "571f011a61ab6a61f5e6eec41d862e1451d2e0937e2829429f75a17c460858b1" dependencies = [ "bincode", "bytemuck", @@ -3306,9 +3306,9 @@ dependencies = [ [[package]] name = "solana-banks-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c065226230d17f5e333e6ad60db639c4d3d716ca1b2c8b2d8e8e8412f943709" +checksum = "526d5731217a0702eecbb49a4a0a9f106d72e5077e658ef57688b3d9efe6e3f5" dependencies = [ "borsh 0.10.3", "futures", @@ -3323,9 +3323,9 @@ dependencies = [ [[package]] name = "solana-banks-interface" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1093af4fc53baf6a051bbce55f02da8b19d333fe594c79217ee8f5df79cd1161" +checksum = "4f92c8e8baddeb229acbe96be4a919d7f186e05c8f8fc2ad51d0b634816a5c9b" dependencies = [ "serde", "solana-sdk", @@ -3334,9 +3334,9 @@ dependencies = [ [[package]] name = "solana-banks-server" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79583c0841f867d1968ef41564c8a0f4cbc1d9e6616f2d4a26a61ed953b1c00" +checksum = "dad49dc8e38a9f4cced3f297a4242a1eea325cf5de9d8f7af8c1fe951d348cd8" dependencies = [ "bincode", "crossbeam-channel", @@ -3353,9 +3353,9 @@ dependencies = [ [[package]] name = "solana-bpf-loader-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31028b291651242916318f5fb277387ac2ac822ec397af9e739909fd8183ad0a" +checksum = "476efcec2fd6899d1a8b3378bd4e4420d248cd4369217012129efcff528da691" dependencies = [ "bincode", "byteorder", @@ -3372,9 +3372,9 @@ dependencies = [ [[package]] name = "solana-bucket-map" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db635df62e3f1e3b6661ea1e93dbb14e6ef2ddd86ccac72a7842bb594e399f4c" +checksum = "b3faa5818fcdf97f58a75ff20a06ce51cf40e3593b3db6fd08a42f8539e18ddc" dependencies = [ "bv", "log", @@ -3389,9 +3389,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce466531351ab81e9931122bd779369af20f4816f2706b4af47c3ea989de5447" +checksum = "1752e9fe9fb659ab0318cb6aef6b2aa7e0317be5fe7f4e3f74e09c42a4572ec5" dependencies = [ "chrono", "clap 2.34.0", @@ -3407,9 +3407,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d5c898cc260d747f1fafc38faf3005b94737c660047381236b57448a008b10" +checksum = "5e17610496b75585f40b4a26b2a54b07a468d62f09f22c18ed966e6a9006cd74" dependencies = [ "async-trait", "bincode", @@ -3440,9 +3440,9 @@ dependencies = [ [[package]] name = "solana-compute-budget-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98312eeab2d9879bcac78cce213fe65a9d929df6d541c0dcd0ef918968ea2cca" +checksum = "bb9c9031bbf2a774ace3ec991f6b0019134a30e7dafb50b3ede4f2df32c85d5a" dependencies = [ "solana-program-runtime", "solana-sdk", @@ -3450,9 +3450,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaee2ae2c20c8f4d1f4a71fdef18b846ed526a62f3960c1dd397e3214a5c3636" +checksum = "72a707c726e0f1a6764f11fd6c25e129d1fe16dc14a641b7d5f23ab6a1c1f583" dependencies = [ "bincode", "chrono", @@ -3464,9 +3464,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3a18a36fe35598469fbfd3909fcdee3790225367d4a1b6ac3bb77d333cc72" +checksum = "d6024d0046d3672476cafc1d302599b936b9efb69ce1c41efc98b6a9554d07af" dependencies = [ "async-trait", "bincode", @@ -3485,9 +3485,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99cfa99557c93f82428f19629d7aa0bb069a740f5caf0ae0654853e9930cd4c" +checksum = "d89ed0a4ba426c461866700f082a00d490e4bde6d27d2d88e129acb3fde79054" dependencies = [ "ahash 0.8.3", "blake3", @@ -3518,9 +3518,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f9a943b7e086970c1f131c82bed6788b788b49c6b3579388f4989cfcfb47db" +checksum = "b69dd83d2d675cad4ed0f0086a7d0c669dc407213b4bc916555ed329ea93f531" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", @@ -3530,9 +3530,9 @@ dependencies = [ [[package]] name = "solana-loader-v4-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a41c7ce3e3a4a64c8a27aea05e8661a1d1f7c1d78d0d8d676223b714180752" +checksum = "b058e4cad9057315272cda2d2693ab39d49a1448ad4e8c3211b7389c61678c47" dependencies = [ "log", "rand 0.7.3", @@ -3544,9 +3544,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc71a75f90306445902cd0fb1082761bcf5a5b244738e557edfd6ca75f94019a" +checksum = "9a2d34ee6f40d1be05852e9e442b7b3ead2c2ec6fef567079c1c0a4b3d3b8eb3" dependencies = [ "env_logger", "lazy_static", @@ -3555,9 +3555,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2426169e601a2bb12b966b076d5fc33943227e555abb36216f7bf20584cde8e7" +checksum = "848131da616377ecef14f84424f5c28cbffbd0018148452a278d8bc9e5c91399" dependencies = [ "log", "solana-sdk", @@ -3565,9 +3565,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88eab2455a9c2ecf436a503fdc15c64bf8079dbb18f55172b88bcf3b9a3b0a56" +checksum = "a24707f323c8fcbd3f05b6353ec917188aff73ade879dd9bfdaec18f13dde24a" dependencies = [ "crossbeam-channel", "gethostname", @@ -3579,9 +3579,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6bb6bbfc5b19829d0ae30cb77f6942600ddf013b3ea9529c50ca61a18cedd59" +checksum = "81fec117234c551f3b93c7710e800b1786a5226cd62ce80f935b5a43f3a2c9d3" dependencies = [ "bincode", "clap 3.2.25", @@ -3601,9 +3601,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d981579ffa092782bc6deb4510106ce230a0c8074c932bb2564d5e1d9cbe72b" +checksum = "27fb0d9be450228c6eb03808a3e87fb7df61f7d96a042d9967f921a6caea2fe6" dependencies = [ "ahash 0.8.3", "bincode", @@ -3628,9 +3628,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f0785c04ca7709464aa99e3e960a5c09e2318da8658833d410e157b3292a69" +checksum = "c38a798723409541aae8ddc9b69c4c78b798e6c219e3e526b5bd4280974a5f29" dependencies = [ "ark-bn254", "ark-ec", @@ -3683,9 +3683,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76c947ee87c148f646f961d67580402fbe69825e017053fc3cd271afb3eefe" +checksum = "6f2f1803db91cd46bef3b84c5fceff2b5278b0daa651be20c5ec81a37cbccf4d" dependencies = [ "base64 0.21.2", "bincode", @@ -3711,9 +3711,9 @@ dependencies = [ [[package]] name = "solana-program-test" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "333ec33b37d85f48669b3d1f9c68a4b8fcfefe906ed7262c7ed90aa565cd175b" +checksum = "e0a557d319cecaed9a68b88f20c558103b7c43f1e797fc3f11127951c1b62038" dependencies = [ "assert_matches", "async-trait", @@ -3738,9 +3738,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89db8eabe8a22f565a8c26449a65dc80acd9ae5332a2008649c464e75714039" +checksum = "591cc19e71fca27a344cb08ae6e906f8b2e8cfa10e9cc74a0676044b157e3506" dependencies = [ "crossbeam-channel", "futures-util", @@ -3763,9 +3763,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a944cbeec6904d1023186dd9387f3f498b369c54f2bb7e55e2d76ab6a069bf" +checksum = "05db835947c6623c86ef3b21baf388ea016e03039252fcf20a2789fce4962eb1" dependencies = [ "async-mutex", "async-trait", @@ -3791,9 +3791,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c699b849a013036f6bda8219ecb2803708df2a829042ae909ceb939c77b44970" +checksum = "111747d986e2d968084de753a8034d486471c6a6192a16c31ec1c2eee95b2d47" dependencies = [ "lazy_static", "num_cpus", @@ -3801,9 +3801,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056e7531f56893258151396b97a0da757f4deea55192c08df9c62cb62b82e957" +checksum = "3e71075e996f5b9ac83f6fb068361fd2f4bcd7319832b3eea1ef2f705d84942b" dependencies = [ "console", "dialoguer", @@ -3820,9 +3820,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d904dc51c52242b2e9e14b927af70ea04f0f74c99fa5db42981598885061b6" +checksum = "77d9c7a14b02ace2d22838a2656512fd91003ebac59301fd898dcec4fcb87737" dependencies = [ "async-trait", "base64 0.21.2", @@ -3846,9 +3846,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bdf329e0d27ecbbfb73e5a060a23e9f9a26619b5ed56f673465342da1609e7c" +checksum = "ad7a807372d7b3e9b4b70189d311a3d7c734c9354d604befc5d099a097803192" dependencies = [ "base64 0.21.2", "bs58", @@ -3868,9 +3868,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf7e472d24e18f6d8e7e2dd7b5c71c02b0768898bad4cf4465542bdca91be9a" +checksum = "557b43c6fa4e364e9334900afb026998ec1d3a20f4471138f4744aa35abd7fb5" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -3881,9 +3881,9 @@ dependencies = [ [[package]] name = "solana-runtime" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517d0900bd0e71a5748674820724b605f30cbe5b8d38ed83b520dddd0177b54" +checksum = "d7b736ed27efa42c3baad5ab25fa1e53fa49f52855cb7f6aeee3a7168fc403bc" dependencies = [ "arrayref", "bincode", @@ -3950,9 +3950,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ba95264245a5e9597362e4e6e3a50b538fbe5aaaf017af665a49b541beb25" +checksum = "ce456629674fdba5556ab109baac6ef5fc4caf5d42e375a1e3c4413807f3e81c" dependencies = [ "assert_matches", "base64 0.21.2", @@ -4003,9 +4003,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0d5ec9d1e765173704cbe8ea7d8c8d69a9f879d7e71ae7deb0632f9f0ee429" +checksum = "e3e5a8c7e9e91c7d35f24ffd47a04221f76edb9aba968d79ee10e1cb26f16d2f" dependencies = [ "bs58", "proc-macro2 1.0.66", @@ -4016,9 +4016,9 @@ dependencies = [ [[package]] name = "solana-send-transaction-service" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5baf132146882c71da736b4b3efa16cd04464ceaae5d9234bd28bbd622bbc97" +checksum = "f30194bffc07760335352d6fec3a8d65ab17ac653e2f60709a11099722d6f0fe" dependencies = [ "crossbeam-channel", "log", @@ -4032,9 +4032,9 @@ dependencies = [ [[package]] name = "solana-stake-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6601e81f96bb9444c8690b4889a38ae4b8f60f5239207ed71605b234e36a9527" +checksum = "1716d64627a098bf7fc0807ac9a5dc616fe8ade48168f49f80c30c96b2009240" dependencies = [ "bincode", "log", @@ -4047,9 +4047,9 @@ dependencies = [ [[package]] name = "solana-streamer" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7889fb97171c64e06ec4f0efd236aca6873254888a6bf51bb4292e1436b3fdb1" +checksum = "54302d45994b8054f0a86f91684d11343de6dd1007919f8465b74845831012aa" dependencies = [ "async-channel", "bytes", @@ -4080,9 +4080,9 @@ dependencies = [ [[package]] name = "solana-system-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e517487a4115b233260d83fbabf6df6c0b86d5a1f905f06b2498d7987ff0ee68" +checksum = "4b322cdb3118f20472bca12ceb65c29d86f8dedd504591859eb30a904f2ea1c4" dependencies = [ "bincode", "log", @@ -4094,9 +4094,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa94bf1d27b4b4d9c593843f365d635bd276925fa61a7cedbe6bb816225128d" +checksum = "a5ef9e0b5c06c4f573c7b8615dc5fefd55d8b7dbfded6fdf66bd45c0bac975ed" dependencies = [ "bincode", "log", @@ -4109,9 +4109,9 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ab6dbd623ec97b471b490f741795559a48299af860b9cab4c7ccd2c916d0fd" +checksum = "508f295dd72b0a2040322083ed88468a8ab6e5b51caaa34a8054b66452fac39a" dependencies = [ "async-trait", "bincode", @@ -4134,9 +4134,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e5aba173da8ee65e38e4ac55390eaccebff160117e919a73e1d28085e8a203" +checksum = "8b24b10eecf139b2a47b6ccae13685e3c41458e871c57670f9963afe461659f8" dependencies = [ "Inflector", "base64 0.21.2", @@ -4160,9 +4160,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265ce6ae58aacdb5e04a9a579afefc3d0bb61c7c5a00df2dcde2315ace0031e5" +checksum = "b01e752329901acdc2a788044253cdb9439c924832bca8a9c23112429477fd20" dependencies = [ "async-trait", "solana-connection-cache", @@ -4175,9 +4175,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "192ed87b9562c2a15015f51ff5de560b59fa2cd244d2bb0146524af0a693a3b1" +checksum = "976a54918e3e5516e53825d1bfc5f728b97fada082e2cc2e203bd29f9b5640e7" dependencies = [ "log", "rustc_version", @@ -4191,9 +4191,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1910068b362f9b57748e6a0310b178b6c2dc377f3ba9489fd7d66d994ed7ca36" +checksum = "8394fd700d24cd8505233fbf1cdb85fa6de1f40b3a48992ea8b3ee7b7dd28c97" dependencies = [ "bincode", "log", @@ -4213,9 +4213,9 @@ dependencies = [ [[package]] name = "solana-zk-token-proof-program" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4830b0ee93e17800f1b82acacf2c4df28e9feb4d29c2153c6723789f2d3c54e9" +checksum = "bd9be05a31cac0e0fad15e198ac95e9c3f1bcce26c7834bcdfaefbead9c5ff2f" dependencies = [ "bytemuck", "getrandom 0.1.16", @@ -4228,9 +4228,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.16.8" +version = "1.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2822252ffc52c7415fcd0c468fa3c13cbc50bd181087d366fe511d891445cd" +checksum = "de66fbc7bd6cc3177270cb6c157722fb33f8f2cd2c5c3ad555c6f558705678c4" dependencies = [ "aes-gcm-siv", "base64 0.21.2", @@ -4645,9 +4645,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", @@ -5305,7 +5305,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -5338,7 +5338,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -5358,17 +5358,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f51fb4c64f8b770a823c043c7fad036323e1c48f55287b7bbb7987b2fcdf3b" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.3", - "windows_aarch64_msvc 0.48.3", - "windows_i686_gnu 0.48.3", - "windows_i686_msvc 0.48.3", - "windows_x86_64_gnu 0.48.3", - "windows_x86_64_gnullvm 0.48.3", - "windows_x86_64_msvc 0.48.3", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5379,9 +5379,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde1bb55ae4ce76a597a8566d82c57432bc69c039449d61572a7a353da28f68c" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5391,9 +5391,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1513e8d48365a78adad7322fd6b5e4c4e99d92a69db8df2d435b25b1f1f286d4" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5403,9 +5403,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60587c0265d2b842298f5858e1a5d79d146f9ee0c37be5782e92a6eb5e1d7a83" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5415,9 +5415,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224fe0e0ffff5d2ea6a29f82026c8f43870038a0ffc247aa95a52b47df381ac4" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5427,9 +5427,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62fc52a0f50a088de499712cbc012df7ebd94e2d6eb948435449d76a6287e7ad" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5439,9 +5439,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2093925509d91ea3d69bcd20238f4c2ecdb1a29d3c281d026a09705d0dd35f3d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5451,15 +5451,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ade45bc8bf02ae2aa34a9d54ba660a1a58204da34ba793c00d83ca3730b5f1" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.12" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83817bbecf72c73bad717ee86820ebf286203d2e04c3951f3cd538869c897364" +checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" dependencies = [ "memchr", ] diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index a3ac60da..ed037913 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "mpl-token-metadata-sdk" -version = "0.0.1" -description = "Metaplex Token Metadata Client SDK" +name = "mpl-token-metadata" +version = "2.0.0-beta.1" +description = "Metaplex Token Metadata SDK" authors = ["Metaplex Developers "] repository = "https://github.com/metaplex-foundation/mpl-token-metadata" license-file = "../../LICENSE" diff --git a/clients/rust/README.md b/clients/rust/README.md index 22a72a77..912c0b61 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -2,7 +2,7 @@ Metaplex Token Metadata SDK

- Rust library for interacting with Token Metadata program. + Rust library for interacting with Token Metadata program.

@@ -208,14 +208,14 @@ impl Metadata { ``` > If a bump seed is known, it is _cheaper_ (in terms of compute units) to use the `create_pda` function, in particular for on-chain code. - ## Why using a client library? + ## Why using a client library (SDK)? Using a program crate as a dependency has its caveats. The main one is that you are bound to the same dependencies of that program, which tend to be quite a few. In many cases, this leads to dependency problems when trying to update crate versions. Secondly, the program crate is generated from the program source code, which its main purpose is to offer the functionality of the program, not necessarily a _friendly_ client API. Enter an SDK crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. > **Note** - > Although the SDK crate has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies from the `solana-program`. + > Although the SDK crate has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies of the `solana-program`. ## Testing diff --git a/clients/rust/src/generated/accounts/collection_authority_record.rs b/clients/rust/src/generated/accounts/collection_authority_record.rs index 786c82c7..657840e8 100644 --- a/clients/rust/src/generated/accounts/collection_authority_record.rs +++ b/clients/rust/src/generated/accounts/collection_authority_record.rs @@ -25,12 +25,12 @@ impl CollectionAuthorityRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "collection_authority".as_bytes(), collection_authority.as_ref(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -41,13 +41,13 @@ impl CollectionAuthorityRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "collection_authority".as_bytes(), collection_authority.as_ref(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/edition_marker.rs b/clients/rust/src/generated/accounts/edition_marker.rs index 9a1aac7e..1f7f5b93 100644 --- a/clients/rust/src/generated/accounts/edition_marker.rs +++ b/clients/rust/src/generated/accounts/edition_marker.rs @@ -23,12 +23,12 @@ impl EditionMarker { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), edition_marker.to_string().as_ref(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -39,13 +39,13 @@ impl EditionMarker { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), edition_marker.to_string().as_ref(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/master_edition.rs b/clients/rust/src/generated/accounts/master_edition.rs index f58194bb..6cc68b4d 100644 --- a/clients/rust/src/generated/accounts/master_edition.rs +++ b/clients/rust/src/generated/accounts/master_edition.rs @@ -24,11 +24,11 @@ impl MasterEdition { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -38,12 +38,12 @@ impl MasterEdition { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "edition".as_bytes(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/master_edition_v1.rs b/clients/rust/src/generated/accounts/master_edition_v1.rs deleted file mode 100644 index 3abe958c..00000000 --- a/clients/rust/src/generated/accounts/master_edition_v1.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Key; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; -use solana_program::pubkey::Pubkey; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -pub struct MasterEditionV1 { - pub key: Key, - pub supply: u64, - pub max_supply: Option, - pub printing_mint: Pubkey, - pub one_time_printing_authorization_mint: Pubkey, -} - -impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for MasterEditionV1 { - type Error = std::io::Error; - - fn try_from( - account_info: &'a solana_program::account_info::AccountInfo<'a>, - ) -> Result { - let mut data: &[u8] = &(*account_info.data).borrow(); - Self::deserialize(&mut data) - } -} diff --git a/clients/rust/src/generated/accounts/metadata.rs b/clients/rust/src/generated/accounts/metadata.rs index b212551d..ce9ab4f7 100644 --- a/clients/rust/src/generated/accounts/metadata.rs +++ b/clients/rust/src/generated/accounts/metadata.rs @@ -43,10 +43,10 @@ impl Metadata { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -56,11 +56,11 @@ impl Metadata { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs index ae582f56..17c61b50 100644 --- a/clients/rust/src/generated/accounts/metadata_delegate_record.rs +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -32,13 +32,13 @@ impl MetadataDelegateRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), delegate_role.to_string().as_ref(), update_authority.as_ref(), delegate.as_ref(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -51,14 +51,14 @@ impl MetadataDelegateRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), delegate_role.to_string().as_ref(), update_authority.as_ref(), delegate.as_ref(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/mod.rs b/clients/rust/src/generated/accounts/mod.rs index 89b74598..a2fd9d0b 100644 --- a/clients/rust/src/generated/accounts/mod.rs +++ b/clients/rust/src/generated/accounts/mod.rs @@ -10,11 +10,8 @@ mod edition; mod edition_marker; mod edition_marker_v2; mod master_edition; -mod master_edition_v1; mod metadata; mod metadata_delegate_record; -mod reservation_list_v1; -mod reservation_list_v2; mod token_owned_escrow; mod token_record; mod use_authority_record; @@ -24,11 +21,8 @@ pub use edition::*; pub use edition_marker::*; pub use edition_marker_v2::*; pub use master_edition::*; -pub use master_edition_v1::*; pub use metadata::*; pub use metadata_delegate_record::*; -pub use reservation_list_v1::*; -pub use reservation_list_v2::*; pub use token_owned_escrow::*; pub use token_record::*; pub use use_authority_record::*; diff --git a/clients/rust/src/generated/accounts/reservation_list_v1.rs b/clients/rust/src/generated/accounts/reservation_list_v1.rs deleted file mode 100644 index 71cb020d..00000000 --- a/clients/rust/src/generated/accounts/reservation_list_v1.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Key; -use crate::generated::types::ReservationV1; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; -use solana_program::pubkey::Pubkey; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -pub struct ReservationListV1 { - pub key: Key, - pub master_edition: Pubkey, - pub supply_snapshot: Option, - pub reservations: Vec, -} - -impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for ReservationListV1 { - type Error = std::io::Error; - - fn try_from( - account_info: &'a solana_program::account_info::AccountInfo<'a>, - ) -> Result { - let mut data: &[u8] = &(*account_info.data).borrow(); - Self::deserialize(&mut data) - } -} diff --git a/clients/rust/src/generated/accounts/reservation_list_v2.rs b/clients/rust/src/generated/accounts/reservation_list_v2.rs deleted file mode 100644 index 2e767308..00000000 --- a/clients/rust/src/generated/accounts/reservation_list_v2.rs +++ /dev/null @@ -1,33 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Key; -use crate::generated::types::Reservation; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; -use solana_program::pubkey::Pubkey; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -pub struct ReservationListV2 { - pub key: Key, - pub master_edition: Pubkey, - pub supply_snapshot: Option, - pub reservations: Vec, - pub total_reservation_spots: u64, - pub current_reservation_spots: u64, -} - -impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for ReservationListV2 { - type Error = std::io::Error; - - fn try_from( - account_info: &'a solana_program::account_info::AccountInfo<'a>, - ) -> Result { - let mut data: &[u8] = &(*account_info.data).borrow(); - Self::deserialize(&mut data) - } -} diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs index d4e60543..7840e082 100644 --- a/clients/rust/src/generated/accounts/token_record.rs +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -30,12 +30,12 @@ impl TokenRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "token_record".as_bytes(), token.as_ref(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -46,13 +46,13 @@ impl TokenRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "token_record".as_bytes(), token.as_ref(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/accounts/use_authority_record.rs b/clients/rust/src/generated/accounts/use_authority_record.rs index 003a2db6..2a514bce 100644 --- a/clients/rust/src/generated/accounts/use_authority_record.rs +++ b/clients/rust/src/generated/accounts/use_authority_record.rs @@ -24,12 +24,12 @@ impl UseAuthorityRecord { solana_program::pubkey::Pubkey::find_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "user".as_bytes(), use_authority.as_ref(), ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } pub fn create_pda( @@ -40,13 +40,13 @@ impl UseAuthorityRecord { solana_program::pubkey::Pubkey::create_program_address( &[ "metadata".as_bytes(), - crate::TOKEN_METADATA_ID.as_ref(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), mint.as_ref(), "user".as_bytes(), use_authority.as_ref(), &[bump], ], - &crate::TOKEN_METADATA_ID, + &crate::MPL_TOKEN_METADATA_ID, ) } } diff --git a/clients/rust/src/generated/errors/mod.rs b/clients/rust/src/generated/errors/mod.rs index 8980b3c7..b2dd94ed 100644 --- a/clients/rust/src/generated/errors/mod.rs +++ b/clients/rust/src/generated/errors/mod.rs @@ -5,6 +5,6 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -mod token_metadata; +mod mpl_token_metadata; -pub use token_metadata::TokenMetadataError; +pub use mpl_token_metadata::MplTokenMetadataError; diff --git a/clients/rust/src/generated/errors/token_metadata.rs b/clients/rust/src/generated/errors/mpl_token_metadata.rs similarity index 99% rename from clients/rust/src/generated/errors/token_metadata.rs rename to clients/rust/src/generated/errors/mpl_token_metadata.rs index abc4c3e5..e83b0d09 100644 --- a/clients/rust/src/generated/errors/token_metadata.rs +++ b/clients/rust/src/generated/errors/mpl_token_metadata.rs @@ -9,7 +9,7 @@ use num_derive::FromPrimitive; use thiserror::Error; #[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)] -pub enum TokenMetadataError { +pub enum MplTokenMetadataError { /// 0x0 - #[error("")] InstructionUnpackError, @@ -591,7 +591,7 @@ pub enum TokenMetadataError { InvalidMetadataFlags, } -impl solana_program::program_error::PrintProgramError for TokenMetadataError { +impl solana_program::program_error::PrintProgramError for MplTokenMetadataError { fn print(&self) { solana_program::msg!(&self.to_string()); } diff --git a/clients/rust/src/generated/instructions/approve_collection_authority.rs b/clients/rust/src/generated/instructions/approve_collection_authority.rs index b7fe1383..7711317c 100644 --- a/clients/rust/src/generated/instructions/approve_collection_authority.rs +++ b/clients/rust/src/generated/instructions/approve_collection_authority.rs @@ -31,8 +31,6 @@ pub struct ApproveCollectionAuthority { impl ApproveCollectionAuthority { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = ApproveCollectionAuthorityInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( self.collection_authority_record, @@ -66,26 +64,29 @@ impl ApproveCollectionAuthority { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = ApproveCollectionAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct ApproveCollectionAuthorityInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct ApproveCollectionAuthorityInstructionData { discriminator: u8, } -impl ApproveCollectionAuthorityInstructionArgs { - pub fn new() -> Self { +impl ApproveCollectionAuthorityInstructionData { + fn new() -> Self { Self { discriminator: 23 } } } @@ -220,8 +221,6 @@ impl<'a> ApproveCollectionAuthorityCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = ApproveCollectionAuthorityInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( *self.collection_authority_record.key, @@ -257,15 +256,18 @@ impl<'a> ApproveCollectionAuthorityCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = ApproveCollectionAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(8 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/approve_use_authority.rs b/clients/rust/src/generated/instructions/approve_use_authority.rs index d74aafdf..a8e97fac 100644 --- a/clients/rust/src/generated/instructions/approve_use_authority.rs +++ b/clients/rust/src/generated/instructions/approve_use_authority.rs @@ -83,34 +83,40 @@ impl ApproveUseAuthority { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = ApproveUseAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct ApproveUseAuthorityInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct ApproveUseAuthorityInstructionData { discriminator: u8, - pub number_of_uses: u64, } -impl ApproveUseAuthorityInstructionArgs { - pub fn new(number_of_uses: u64) -> Self { - Self { - discriminator: 20, - number_of_uses, - } +impl ApproveUseAuthorityInstructionData { + fn new() -> Self { + Self { discriminator: 20 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct ApproveUseAuthorityInstructionArgs { + pub number_of_uses: u64, +} + /// Instruction builder. #[derive(Default)] pub struct ApproveUseAuthorityBuilder { @@ -233,11 +239,12 @@ impl ApproveUseAuthorityBuilder { .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), rent: self.rent, }; - let args = ApproveUseAuthorityInstructionArgs::new( - self.number_of_uses + let args = ApproveUseAuthorityInstructionArgs { + number_of_uses: self + .number_of_uses .clone() .expect("number_of_uses is not set"), - ); + }; accounts.instruction(args) } @@ -330,15 +337,20 @@ impl<'a> ApproveUseAuthorityCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = ApproveUseAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -480,12 +492,13 @@ impl<'a> ApproveUseAuthorityCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> ApproveUseAuthorityCpi<'a> { - let args = ApproveUseAuthorityInstructionArgs::new( - self.instruction + let args = ApproveUseAuthorityInstructionArgs { + number_of_uses: self + .instruction .number_of_uses .clone() .expect("number_of_uses is not set"), - ); + }; ApproveUseAuthorityCpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs index f50aab56..01dfc23f 100644 --- a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs +++ b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs @@ -53,34 +53,40 @@ impl BubblegumSetCollectionSize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = BubblegumSetCollectionSizeInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct BubblegumSetCollectionSizeInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct BubblegumSetCollectionSizeInstructionData { discriminator: u8, - pub set_collection_size_args: SetCollectionSizeArgs, } -impl BubblegumSetCollectionSizeInstructionArgs { - pub fn new(set_collection_size_args: SetCollectionSizeArgs) -> Self { - Self { - discriminator: 36, - set_collection_size_args, - } +impl BubblegumSetCollectionSizeInstructionData { + fn new() -> Self { + Self { discriminator: 36 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct BubblegumSetCollectionSizeInstructionArgs { + pub set_collection_size_args: SetCollectionSizeArgs, +} + /// Instruction builder. #[derive(Default)] pub struct BubblegumSetCollectionSizeBuilder { @@ -163,11 +169,12 @@ impl BubblegumSetCollectionSizeBuilder { bubblegum_signer: self.bubblegum_signer.expect("bubblegum_signer is not set"), collection_authority_record: self.collection_authority_record, }; - let args = BubblegumSetCollectionSizeInstructionArgs::new( - self.set_collection_size_args + let args = BubblegumSetCollectionSizeInstructionArgs { + set_collection_size_args: self + .set_collection_size_args .clone() .expect("set_collection_size_args is not set"), - ); + }; accounts.instruction(args) } @@ -225,15 +232,20 @@ impl<'a> BubblegumSetCollectionSizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = BubblegumSetCollectionSizeInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(5 + 1); account_infos.push(self.__program.clone()); @@ -327,12 +339,13 @@ impl<'a> BubblegumSetCollectionSizeCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> BubblegumSetCollectionSizeCpi<'a> { - let args = BubblegumSetCollectionSizeInstructionArgs::new( - self.instruction + let args = BubblegumSetCollectionSizeInstructionArgs { + set_collection_size_args: self + .instruction .set_collection_size_args .clone() .expect("set_collection_size_args is not set"), - ); + }; BubblegumSetCollectionSizeCpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/burn_edition_nft.rs b/clients/rust/src/generated/instructions/burn_edition_nft.rs index 6daf1eb0..2a63927f 100644 --- a/clients/rust/src/generated/instructions/burn_edition_nft.rs +++ b/clients/rust/src/generated/instructions/burn_edition_nft.rs @@ -35,8 +35,6 @@ pub struct BurnEditionNft { impl BurnEditionNft { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = BurnEditionNftInstructionArgs::new(); - let mut accounts = Vec::with_capacity(10); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -77,22 +75,23 @@ impl BurnEditionNft { self.spl_token_program, false, )); + let data = BurnEditionNftInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct BurnEditionNftInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct BurnEditionNftInstructionData { discriminator: u8, } -impl BurnEditionNftInstructionArgs { - pub fn new() -> Self { +impl BurnEditionNftInstructionData { + fn new() -> Self { Self { discriminator: 37 } } } @@ -271,8 +270,6 @@ impl<'a> BurnEditionNftCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = BurnEditionNftInstructionArgs::new(); - let mut accounts = Vec::with_capacity(10); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -314,11 +311,12 @@ impl<'a> BurnEditionNftCpi<'a> { *self.spl_token_program.key, false, )); + let data = BurnEditionNftInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(10 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/burn_nft.rs b/clients/rust/src/generated/instructions/burn_nft.rs index 719cbb22..b44c91b5 100644 --- a/clients/rust/src/generated/instructions/burn_nft.rs +++ b/clients/rust/src/generated/instructions/burn_nft.rs @@ -29,8 +29,6 @@ pub struct BurnNft { impl BurnNft { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = BurnNftInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -61,26 +59,27 @@ impl BurnNft { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = BurnNftInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct BurnNftInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct BurnNftInstructionData { discriminator: u8, } -impl BurnNftInstructionArgs { - pub fn new() -> Self { +impl BurnNftInstructionData { + fn new() -> Self { Self { discriminator: 29 } } } @@ -203,8 +202,6 @@ impl<'a> BurnNftCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = BurnNftInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -237,15 +234,16 @@ impl<'a> BurnNftCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = BurnNftInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/burn_v1.rs b/clients/rust/src/generated/instructions/burn_v1.rs index fef41c9a..47b3216d 100644 --- a/clients/rust/src/generated/instructions/burn_v1.rs +++ b/clients/rust/src/generated/instructions/burn_v1.rs @@ -42,9 +42,10 @@ pub struct BurnV1 { impl BurnV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = BurnV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: BurnV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); accounts.push(solana_program::instruction::AccountMeta::new( self.authority, @@ -57,7 +58,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -71,7 +72,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -88,7 +89,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -99,7 +100,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -110,7 +111,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl BurnV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -148,32 +149,38 @@ impl BurnV1 { self.spl_token_program, false, )); + let mut data = BurnV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct BurnV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct BurnV1InstructionData { discriminator: u8, burn_v1_discriminator: u8, - pub amount: u64, } -impl BurnV1InstructionArgs { - pub fn new() -> Self { +impl BurnV1InstructionData { + fn new() -> Self { Self { discriminator: 41, burn_v1_discriminator: 0, - amount: 1, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct BurnV1InstructionArgs { + pub amount: u64, +} + /// Instruction builder. #[derive(Default)] pub struct BurnV1Builder { @@ -304,6 +311,7 @@ impl BurnV1Builder { self.spl_token_program = Some(spl_token_program); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -333,8 +341,11 @@ impl BurnV1Builder { "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" )), }; + let args = BurnV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -370,6 +381,8 @@ pub struct BurnV1Cpi<'a> { pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, /// SPL Token Program pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// The arguments for the instruction. + pub __args: BurnV1InstructionArgs, } impl<'a> BurnV1Cpi<'a> { @@ -382,8 +395,6 @@ impl<'a> BurnV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = BurnV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); accounts.push(solana_program::instruction::AccountMeta::new( *self.authority.key, @@ -396,7 +407,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -411,7 +422,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -430,7 +441,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -441,7 +452,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -452,7 +463,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -463,7 +474,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -474,7 +485,7 @@ impl<'a> BurnV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -490,11 +501,14 @@ impl<'a> BurnV1Cpi<'a> { *self.spl_token_program.key, false, )); + let mut data = BurnV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -689,6 +703,7 @@ impl<'a> BurnV1CpiBuilder<'a> { self.instruction.spl_token_program = Some(spl_token_program); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -696,6 +711,10 @@ impl<'a> BurnV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> BurnV1Cpi<'a> { + let args = BurnV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + }; + BurnV1Cpi { __program: self.instruction.__program, @@ -735,6 +754,7 @@ impl<'a> BurnV1CpiBuilder<'a> { .instruction .spl_token_program .expect("spl_token_program is not set"), + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/close_escrow_account.rs b/clients/rust/src/generated/instructions/close_escrow_account.rs index 29dddd82..5cc745dc 100644 --- a/clients/rust/src/generated/instructions/close_escrow_account.rs +++ b/clients/rust/src/generated/instructions/close_escrow_account.rs @@ -31,8 +31,6 @@ pub struct CloseEscrowAccount { impl CloseEscrowAccount { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = CloseEscrowAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( self.escrow, @@ -64,22 +62,25 @@ impl CloseEscrowAccount { self.sysvar_instructions, false, )); + let data = CloseEscrowAccountInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct CloseEscrowAccountInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct CloseEscrowAccountInstructionData { discriminator: u8, } -impl CloseEscrowAccountInstructionArgs { - pub fn new() -> Self { +impl CloseEscrowAccountInstructionData { + fn new() -> Self { Self { discriminator: 39 } } } @@ -205,8 +206,6 @@ impl<'a> CloseEscrowAccountCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = CloseEscrowAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( *self.escrow.key, @@ -240,11 +239,14 @@ impl<'a> CloseEscrowAccountCpi<'a> { *self.sysvar_instructions.key, false, )); + let data = CloseEscrowAccountInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(8 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/collect.rs b/clients/rust/src/generated/instructions/collect.rs index c03afb65..285a7742 100644 --- a/clients/rust/src/generated/instructions/collect.rs +++ b/clients/rust/src/generated/instructions/collect.rs @@ -19,8 +19,6 @@ pub struct Collect { impl Collect { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = CollectInstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -30,22 +28,23 @@ impl Collect { self.pda_account, false, )); + let data = CollectInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct CollectInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct CollectInstructionData { discriminator: u8, } -impl CollectInstructionArgs { - pub fn new() -> Self { +impl CollectInstructionData { + fn new() -> Self { Self { discriminator: 54 } } } @@ -104,8 +103,6 @@ impl<'a> CollectCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = CollectInstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -115,11 +112,12 @@ impl<'a> CollectCpi<'a> { *self.pda_account.key, false, )); + let data = CollectInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(2 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs index 452b35c5..617394f9 100644 --- a/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs +++ b/clients/rust/src/generated/instructions/convert_master_edition_v1_to_v2.rs @@ -21,8 +21,6 @@ pub struct ConvertMasterEditionV1ToV2 { impl ConvertMasterEditionV1ToV2 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = ConvertMasterEditionV1ToV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(3); accounts.push(solana_program::instruction::AccountMeta::new( self.master_edition, @@ -36,22 +34,25 @@ impl ConvertMasterEditionV1ToV2 { self.printing_mint, false, )); + let data = ConvertMasterEditionV1ToV2InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct ConvertMasterEditionV1ToV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct ConvertMasterEditionV1ToV2InstructionData { discriminator: u8, } -impl ConvertMasterEditionV1ToV2InstructionArgs { - pub fn new() -> Self { +impl ConvertMasterEditionV1ToV2InstructionData { + fn new() -> Self { Self { discriminator: 12 } } } @@ -120,8 +121,6 @@ impl<'a> ConvertMasterEditionV1ToV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = ConvertMasterEditionV1ToV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(3); accounts.push(solana_program::instruction::AccountMeta::new( *self.master_edition.key, @@ -135,11 +134,14 @@ impl<'a> ConvertMasterEditionV1ToV2Cpi<'a> { *self.printing_mint.key, false, )); + let data = ConvertMasterEditionV1ToV2InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(3 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/create_escrow_account.rs b/clients/rust/src/generated/instructions/create_escrow_account.rs index ac251142..c31279c7 100644 --- a/clients/rust/src/generated/instructions/create_escrow_account.rs +++ b/clients/rust/src/generated/instructions/create_escrow_account.rs @@ -33,8 +33,6 @@ pub struct CreateEscrowAccount { impl CreateEscrowAccount { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = CreateEscrowAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(9); accounts.push(solana_program::instruction::AccountMeta::new( self.escrow, @@ -72,26 +70,29 @@ impl CreateEscrowAccount { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = CreateEscrowAccountInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct CreateEscrowAccountInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct CreateEscrowAccountInstructionData { discriminator: u8, } -impl CreateEscrowAccountInstructionArgs { - pub fn new() -> Self { +impl CreateEscrowAccountInstructionData { + fn new() -> Self { Self { discriminator: 38 } } } @@ -228,8 +229,6 @@ impl<'a> CreateEscrowAccountCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = CreateEscrowAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(9); accounts.push(solana_program::instruction::AccountMeta::new( *self.escrow.key, @@ -270,15 +269,18 @@ impl<'a> CreateEscrowAccountCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = CreateEscrowAccountInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(9 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/create_master_edition_v3.rs b/clients/rust/src/generated/instructions/create_master_edition_v3.rs index 7771c7a3..404b04b6 100644 --- a/clients/rust/src/generated/instructions/create_master_edition_v3.rs +++ b/clients/rust/src/generated/instructions/create_master_edition_v3.rs @@ -73,34 +73,40 @@ impl CreateMasterEditionV3 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = CreateMasterEditionV3InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct CreateMasterEditionV3InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct CreateMasterEditionV3InstructionData { discriminator: u8, - pub max_supply: Option, } -impl CreateMasterEditionV3InstructionArgs { - pub fn new(max_supply: Option) -> Self { - Self { - discriminator: 17, - max_supply, - } +impl CreateMasterEditionV3InstructionData { + fn new() -> Self { + Self { discriminator: 17 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateMasterEditionV3InstructionArgs { + pub max_supply: Option, +} + /// Instruction builder. #[derive(Default)] pub struct CreateMasterEditionV3Builder { @@ -201,7 +207,9 @@ impl CreateMasterEditionV3Builder { .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), rent: self.rent, }; - let args = CreateMasterEditionV3InstructionArgs::new(self.max_supply.clone()); + let args = CreateMasterEditionV3InstructionArgs { + max_supply: self.max_supply.clone(), + }; accounts.instruction(args) } @@ -282,15 +290,20 @@ impl<'a> CreateMasterEditionV3Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = CreateMasterEditionV3InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(9 + 1); account_infos.push(self.__program.clone()); @@ -417,7 +430,9 @@ impl<'a> CreateMasterEditionV3CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> CreateMasterEditionV3Cpi<'a> { - let args = CreateMasterEditionV3InstructionArgs::new(self.instruction.max_supply.clone()); + let args = CreateMasterEditionV3InstructionArgs { + max_supply: self.instruction.max_supply.clone(), + }; CreateMasterEditionV3Cpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs index cfa56411..30be5462 100644 --- a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs +++ b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs @@ -63,42 +63,42 @@ impl CreateMetadataAccountV3 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = CreateMetadataAccountV3InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } +#[derive(BorshDeserialize, BorshSerialize)] +struct CreateMetadataAccountV3InstructionData { + discriminator: u8, +} + +impl CreateMetadataAccountV3InstructionData { + fn new() -> Self { + Self { discriminator: 33 } + } +} + #[derive(BorshSerialize, BorshDeserialize, Debug)] pub struct CreateMetadataAccountV3InstructionArgs { - discriminator: u8, pub data: DataV2, pub is_mutable: bool, pub collection_details: Option, } -impl CreateMetadataAccountV3InstructionArgs { - pub fn new( - data: DataV2, - is_mutable: bool, - collection_details: Option, - ) -> Self { - Self { - discriminator: 33, - data, - is_mutable, - collection_details, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct CreateMetadataAccountV3Builder { @@ -193,11 +193,11 @@ impl CreateMetadataAccountV3Builder { .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), rent: self.rent, }; - let args = CreateMetadataAccountV3InstructionArgs::new( - self.data.clone().expect("data is not set"), - self.is_mutable.clone().expect("is_mutable is not set"), - self.collection_details.clone(), - ); + let args = CreateMetadataAccountV3InstructionArgs { + data: self.data.clone().expect("data is not set"), + is_mutable: self.is_mutable.clone().expect("is_mutable is not set"), + collection_details: self.collection_details.clone(), + }; accounts.instruction(args) } @@ -266,15 +266,20 @@ impl<'a> CreateMetadataAccountV3Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = CreateMetadataAccountV3InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); @@ -391,14 +396,15 @@ impl<'a> CreateMetadataAccountV3CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> CreateMetadataAccountV3Cpi<'a> { - let args = CreateMetadataAccountV3InstructionArgs::new( - self.instruction.data.clone().expect("data is not set"), - self.instruction + let args = CreateMetadataAccountV3InstructionArgs { + data: self.instruction.data.clone().expect("data is not set"), + is_mutable: self + .instruction .is_mutable .clone() .expect("is_mutable is not set"), - self.instruction.collection_details.clone(), - ); + collection_details: self.instruction.collection_details.clone(), + }; CreateMetadataAccountV3Cpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/create_v1.rs b/clients/rust/src/generated/instructions/create_v1.rs index 62306cd1..92c79f32 100644 --- a/clients/rust/src/generated/instructions/create_v1.rs +++ b/clients/rust/src/generated/instructions/create_v1.rs @@ -55,7 +55,7 @@ impl CreateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -86,19 +86,35 @@ impl CreateV1 { self.spl_token_program, false, )); + let mut data = CreateV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct CreateV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct CreateV1InstructionData { discriminator: u8, create_v1_discriminator: u8, +} + +impl CreateV1InstructionData { + fn new() -> Self { + Self { + discriminator: 42, + create_v1_discriminator: 0, + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateV1InstructionArgs { pub name: String, pub symbol: String, pub uri: String, @@ -115,35 +131,6 @@ pub struct CreateV1InstructionArgs { pub print_supply: Option, } -impl CreateV1InstructionArgs { - pub fn new( - name: String, - uri: String, - seller_fee_basis_points: u16, - creators: Option>, - token_standard: TokenStandard, - ) -> Self { - Self { - discriminator: 42, - create_v1_discriminator: 0, - name, - symbol: String::from(""), - uri, - seller_fee_basis_points, - creators, - primary_sale_happened: false, - is_mutable: true, - token_standard, - collection: None, - uses: None, - collection_details: None, - rule_set: None, - decimals: None, - print_supply: None, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct CreateV1Builder { @@ -246,6 +233,7 @@ impl CreateV1Builder { self.name = Some(name); self } + /// `[optional argument, defaults to 'String::from("")']` #[inline(always)] pub fn symbol(&mut self, symbol: String) -> &mut Self { self.symbol = Some(symbol); @@ -267,11 +255,13 @@ impl CreateV1Builder { self.creators = Some(creators); self } + /// `[optional argument, defaults to 'false']` #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument, defaults to 'true']` #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.is_mutable = Some(is_mutable); @@ -337,32 +327,28 @@ impl CreateV1Builder { "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" )), }; - let mut args = CreateV1InstructionArgs::new( - self.name.clone().expect("name is not set"), - self.uri.clone().expect("uri is not set"), - self.seller_fee_basis_points + let args = CreateV1InstructionArgs { + name: self.name.clone().expect("name is not set"), + symbol: self.symbol.clone().unwrap_or(String::from("")), + uri: self.uri.clone().expect("uri is not set"), + seller_fee_basis_points: self + .seller_fee_basis_points .clone() .expect("seller_fee_basis_points is not set"), - self.creators.clone(), - self.token_standard + creators: self.creators.clone(), + primary_sale_happened: self.primary_sale_happened.clone().unwrap_or(false), + is_mutable: self.is_mutable.clone().unwrap_or(true), + token_standard: self + .token_standard .clone() .expect("token_standard is not set"), - ); - if let Some(symbol) = &self.symbol { - args.symbol = symbol.clone(); - } - if let Some(primary_sale_happened) = &self.primary_sale_happened { - args.primary_sale_happened = primary_sale_happened.clone(); - } - if let Some(is_mutable) = &self.is_mutable { - args.is_mutable = is_mutable.clone(); - } - args.collection = self.collection.clone(); - args.uses = self.uses.clone(); - args.collection_details = self.collection_details.clone(); - args.rule_set = self.rule_set.clone(); - args.decimals = self.decimals.clone(); - args.print_supply = self.print_supply.clone(); + collection: self.collection.clone(), + uses: self.uses.clone(), + collection_details: self.collection_details.clone(), + rule_set: self.rule_set.clone(), + decimals: self.decimals.clone(), + print_supply: self.print_supply.clone(), + }; accounts.instruction(args) } @@ -416,7 +402,7 @@ impl<'a> CreateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -448,11 +434,14 @@ impl<'a> CreateV1Cpi<'a> { *self.spl_token_program.key, false, )); + let mut data = CreateV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(9 + 1); account_infos.push(self.__program.clone()); @@ -597,6 +586,7 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.name = Some(name); self } + /// `[optional argument, defaults to 'String::from("")']` #[inline(always)] pub fn symbol(&mut self, symbol: String) -> &mut Self { self.instruction.symbol = Some(symbol); @@ -618,11 +608,13 @@ impl<'a> CreateV1CpiBuilder<'a> { self.instruction.creators = Some(creators); self } + /// `[optional argument, defaults to 'false']` #[inline(always)] pub fn primary_sale_happened(&mut self, primary_sale_happened: bool) -> &mut Self { self.instruction.primary_sale_happened = Some(primary_sale_happened); self } + /// `[optional argument, defaults to 'true']` #[inline(always)] pub fn is_mutable(&mut self, is_mutable: bool) -> &mut Self { self.instruction.is_mutable = Some(is_mutable); @@ -671,34 +663,34 @@ impl<'a> CreateV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> CreateV1Cpi<'a> { - let mut args = CreateV1InstructionArgs::new( - self.instruction.name.clone().expect("name is not set"), - self.instruction.uri.clone().expect("uri is not set"), - self.instruction + let args = CreateV1InstructionArgs { + name: self.instruction.name.clone().expect("name is not set"), + symbol: self.instruction.symbol.clone().unwrap_or(String::from("")), + uri: self.instruction.uri.clone().expect("uri is not set"), + seller_fee_basis_points: self + .instruction .seller_fee_basis_points .clone() .expect("seller_fee_basis_points is not set"), - self.instruction.creators.clone(), - self.instruction + creators: self.instruction.creators.clone(), + primary_sale_happened: self + .instruction + .primary_sale_happened + .clone() + .unwrap_or(false), + is_mutable: self.instruction.is_mutable.clone().unwrap_or(true), + token_standard: self + .instruction .token_standard .clone() .expect("token_standard is not set"), - ); - if let Some(symbol) = &self.instruction.symbol { - args.symbol = symbol.clone(); - } - if let Some(primary_sale_happened) = &self.instruction.primary_sale_happened { - args.primary_sale_happened = primary_sale_happened.clone(); - } - if let Some(is_mutable) = &self.instruction.is_mutable { - args.is_mutable = is_mutable.clone(); - } - args.collection = self.instruction.collection.clone(); - args.uses = self.instruction.uses.clone(); - args.collection_details = self.instruction.collection_details.clone(); - args.rule_set = self.instruction.rule_set.clone(); - args.decimals = self.instruction.decimals.clone(); - args.print_supply = self.instruction.print_supply.clone(); + collection: self.instruction.collection.clone(), + uses: self.instruction.uses.clone(), + collection_details: self.instruction.collection_details.clone(), + rule_set: self.instruction.rule_set.clone(), + decimals: self.instruction.decimals.clone(), + print_supply: self.instruction.print_supply.clone(), + }; CreateV1Cpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs index e0fb1eb9..72619cf5 100644 --- a/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_authority_item_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateAuthorityItemV1 { impl DelegateAuthorityItemV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateAuthorityItemV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateAuthorityItemV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateAuthorityItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,44 @@ impl DelegateAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateAuthorityItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateAuthorityItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateAuthorityItemV1InstructionData { discriminator: u8, delegate_authority_item_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateAuthorityItemV1InstructionArgs { - pub fn new() -> Self { +impl DelegateAuthorityItemV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_authority_item_v1_discriminator: 9, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateAuthorityItemV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateAuthorityItemV1Builder { @@ -331,8 +340,11 @@ impl DelegateAuthorityItemV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateAuthorityItemV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +380,8 @@ pub struct DelegateAuthorityItemV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateAuthorityItemV1InstructionArgs, } impl<'a> DelegateAuthorityItemV1Cpi<'a> { @@ -380,8 +394,6 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateAuthorityItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +402,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +421,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +432,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +446,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +473,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +484,7 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +495,20 @@ impl<'a> DelegateAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateAuthorityItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +708,10 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateAuthorityItemV1Cpi<'a> { + let args = DelegateAuthorityItemV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateAuthorityItemV1Cpi { __program: self.instruction.__program, @@ -727,6 +748,7 @@ impl<'a> DelegateAuthorityItemV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs index e1ab0c2b..575e2f06 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_item_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateCollectionItemV1 { impl DelegateCollectionItemV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateCollectionItemV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateCollectionItemV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateCollectionItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,44 @@ impl DelegateCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateCollectionItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateCollectionItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateCollectionItemV1InstructionData { discriminator: u8, delegate_collection_item_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateCollectionItemV1InstructionArgs { - pub fn new() -> Self { +impl DelegateCollectionItemV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_collection_item_v1_discriminator: 11, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateCollectionItemV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateCollectionItemV1Builder { @@ -331,8 +340,11 @@ impl DelegateCollectionItemV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateCollectionItemV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +380,8 @@ pub struct DelegateCollectionItemV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateCollectionItemV1InstructionArgs, } impl<'a> DelegateCollectionItemV1Cpi<'a> { @@ -380,8 +394,6 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateCollectionItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +402,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +421,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +432,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +446,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +473,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +484,7 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +495,20 @@ impl<'a> DelegateCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateCollectionItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +708,10 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateCollectionItemV1Cpi<'a> { + let args = DelegateCollectionItemV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateCollectionItemV1Cpi { __program: self.instruction.__program, @@ -727,6 +748,7 @@ impl<'a> DelegateCollectionItemV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_collection_v1.rs b/clients/rust/src/generated/instructions/delegate_collection_v1.rs index df5225e5..45aa6d90 100644 --- a/clients/rust/src/generated/instructions/delegate_collection_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_collection_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateCollectionV1 { impl DelegateCollectionV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateCollectionV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateCollectionV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateCollectionV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,44 @@ impl DelegateCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateCollectionV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateCollectionV1InstructionData { discriminator: u8, delegate_collection_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateCollectionV1InstructionArgs { - pub fn new() -> Self { +impl DelegateCollectionV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_collection_v1_discriminator: 0, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateCollectionV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateCollectionV1Builder { @@ -331,8 +340,11 @@ impl DelegateCollectionV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateCollectionV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +380,8 @@ pub struct DelegateCollectionV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateCollectionV1InstructionArgs, } impl<'a> DelegateCollectionV1Cpi<'a> { @@ -380,8 +394,6 @@ impl<'a> DelegateCollectionV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +402,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +421,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +432,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +446,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +473,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +484,7 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +495,20 @@ impl<'a> DelegateCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +708,10 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateCollectionV1Cpi<'a> { + let args = DelegateCollectionV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateCollectionV1Cpi { __program: self.instruction.__program, @@ -727,6 +748,7 @@ impl<'a> DelegateCollectionV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs index 0bff7904..2094250c 100644 --- a/clients/rust/src/generated/instructions/delegate_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_item_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateDataItemV1 { impl DelegateDataItemV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateDataItemV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateDataItemV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateDataItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,44 @@ impl DelegateDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateDataItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateDataItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateDataItemV1InstructionData { discriminator: u8, delegate_data_item_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateDataItemV1InstructionArgs { - pub fn new() -> Self { +impl DelegateDataItemV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_data_item_v1_discriminator: 10, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateDataItemV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateDataItemV1Builder { @@ -331,8 +340,11 @@ impl DelegateDataItemV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateDataItemV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +380,8 @@ pub struct DelegateDataItemV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateDataItemV1InstructionArgs, } impl<'a> DelegateDataItemV1Cpi<'a> { @@ -380,8 +394,6 @@ impl<'a> DelegateDataItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateDataItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +402,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +421,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +432,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +446,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +473,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +484,7 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +495,20 @@ impl<'a> DelegateDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateDataItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +708,10 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateDataItemV1Cpi<'a> { + let args = DelegateDataItemV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateDataItemV1Cpi { __program: self.instruction.__program, @@ -727,6 +748,7 @@ impl<'a> DelegateDataItemV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_data_v1.rs b/clients/rust/src/generated/instructions/delegate_data_v1.rs index a7ae00b0..bc4628bd 100644 --- a/clients/rust/src/generated/instructions/delegate_data_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_data_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateDataV1 { impl DelegateDataV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateDataV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateDataV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateDataV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,42 @@ impl DelegateDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateDataV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateDataV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateDataV1InstructionData { discriminator: u8, delegate_data_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateDataV1InstructionArgs { - pub fn new() -> Self { +impl DelegateDataV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_data_v1_discriminator: 3, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateDataV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateDataV1Builder { @@ -331,8 +338,11 @@ impl DelegateDataV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateDataV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +378,8 @@ pub struct DelegateDataV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateDataV1InstructionArgs, } impl<'a> DelegateDataV1Cpi<'a> { @@ -380,8 +392,6 @@ impl<'a> DelegateDataV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateDataV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +400,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +419,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +430,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +444,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +471,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +482,7 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +493,18 @@ impl<'a> DelegateDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateDataV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +704,10 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateDataV1Cpi<'a> { + let args = DelegateDataV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateDataV1Cpi { __program: self.instruction.__program, @@ -727,6 +744,7 @@ impl<'a> DelegateDataV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs index 72185dff..ae126287 100644 --- a/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_locked_transfer_v1.rs @@ -56,7 +56,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -75,7 +75,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -86,7 +86,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -118,7 +118,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -129,7 +129,7 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -140,40 +140,46 @@ impl DelegateLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateLockedTransferV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct DelegateLockedTransferV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateLockedTransferV1InstructionData { discriminator: u8, delegate_locked_transfer_v1_discriminator: u8, - pub amount: u64, - pub locked_address: Pubkey, - pub authorization_data: Option, } -impl DelegateLockedTransferV1InstructionArgs { - pub fn new(locked_address: Pubkey) -> Self { +impl DelegateLockedTransferV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_locked_transfer_v1_discriminator: 7, - amount: 1, - locked_address, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateLockedTransferV1InstructionArgs { + pub amount: u64, + pub locked_address: Pubkey, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateLockedTransferV1Builder { @@ -305,6 +311,7 @@ impl DelegateLockedTransferV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -343,15 +350,14 @@ impl DelegateLockedTransferV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; - let mut args = DelegateLockedTransferV1InstructionArgs::new( - self.locked_address + let args = DelegateLockedTransferV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + locked_address: self + .locked_address .clone() .expect("locked_address is not set"), - ); - if let Some(amount) = &self.amount { - args.amount = amount.clone(); - } - args.authorization_data = self.authorization_data.clone(); + authorization_data: self.authorization_data.clone(), + }; accounts.instruction(args) } @@ -411,7 +417,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -430,7 +436,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -441,7 +447,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -476,7 +482,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -487,7 +493,7 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -498,15 +504,20 @@ impl<'a> DelegateLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateLockedTransferV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -697,6 +708,7 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -715,16 +727,15 @@ impl<'a> DelegateLockedTransferV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateLockedTransferV1Cpi<'a> { - let mut args = DelegateLockedTransferV1InstructionArgs::new( - self.instruction + let args = DelegateLockedTransferV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + locked_address: self + .instruction .locked_address .clone() .expect("locked_address is not set"), - ); - if let Some(amount) = &self.instruction.amount { - args.amount = amount.clone(); - } - args.authorization_data = self.instruction.authorization_data.clone(); + authorization_data: self.instruction.authorization_data.clone(), + }; DelegateLockedTransferV1Cpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs index 8c5407c7..26de8c51 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_item_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateProgrammableConfigItemV1 { impl DelegateProgrammableConfigItemV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateProgrammableConfigItemV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateProgrammableConfigItemV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateProgrammableConfigItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,44 @@ impl DelegateProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateProgrammableConfigItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateProgrammableConfigItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateProgrammableConfigItemV1InstructionData { discriminator: u8, delegate_programmable_config_item_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateProgrammableConfigItemV1InstructionArgs { - pub fn new() -> Self { +impl DelegateProgrammableConfigItemV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_programmable_config_item_v1_discriminator: 12, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateProgrammableConfigItemV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateProgrammableConfigItemV1Builder { @@ -331,8 +340,11 @@ impl DelegateProgrammableConfigItemV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateProgrammableConfigItemV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +380,8 @@ pub struct DelegateProgrammableConfigItemV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateProgrammableConfigItemV1InstructionArgs, } impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { @@ -380,8 +394,6 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateProgrammableConfigItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +402,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +421,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +432,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +446,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +473,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +484,7 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +495,20 @@ impl<'a> DelegateProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateProgrammableConfigItemV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +708,10 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateProgrammableConfigItemV1Cpi<'a> { + let args = DelegateProgrammableConfigItemV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateProgrammableConfigItemV1Cpi { __program: self.instruction.__program, @@ -727,6 +748,7 @@ impl<'a> DelegateProgrammableConfigItemV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs index 72885e25..6cc05f84 100644 --- a/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_programmable_config_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateProgrammableConfigV1 { impl DelegateProgrammableConfigV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateProgrammableConfigV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateProgrammableConfigV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl DelegateProgrammableConfigV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -121,7 +122,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -132,7 +133,7 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -143,36 +144,44 @@ impl DelegateProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateProgrammableConfigV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateProgrammableConfigV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateProgrammableConfigV1InstructionData { discriminator: u8, delegate_programmable_config_v1_discriminator: u8, - pub authorization_data: Option, } -impl DelegateProgrammableConfigV1InstructionArgs { - pub fn new() -> Self { +impl DelegateProgrammableConfigV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_programmable_config_v1_discriminator: 8, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateProgrammableConfigV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateProgrammableConfigV1Builder { @@ -331,8 +340,11 @@ impl DelegateProgrammableConfigV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateProgrammableConfigV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -368,6 +380,8 @@ pub struct DelegateProgrammableConfigV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateProgrammableConfigV1InstructionArgs, } impl<'a> DelegateProgrammableConfigV1Cpi<'a> { @@ -380,8 +394,6 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateProgrammableConfigV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -390,7 +402,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -409,7 +421,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -420,7 +432,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +446,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,7 +473,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -472,7 +484,7 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,15 +495,20 @@ impl<'a> DelegateProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateProgrammableConfigV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -691,6 +708,10 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateProgrammableConfigV1Cpi<'a> { + let args = DelegateProgrammableConfigV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateProgrammableConfigV1Cpi { __program: self.instruction.__program, @@ -727,6 +748,7 @@ impl<'a> DelegateProgrammableConfigV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_sale_v1.rs b/clients/rust/src/generated/instructions/delegate_sale_v1.rs index 58841ce9..d0ecd1ee 100644 --- a/clients/rust/src/generated/instructions/delegate_sale_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_sale_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateSaleV1 { impl DelegateSaleV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateSaleV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateSaleV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -116,7 +117,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -127,7 +128,7 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -138,38 +139,43 @@ impl DelegateSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateSaleV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateSaleV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateSaleV1InstructionData { discriminator: u8, delegate_sale_v1_discriminator: u8, - pub amount: u64, - pub authorization_data: Option, } -impl DelegateSaleV1InstructionArgs { - pub fn new() -> Self { +impl DelegateSaleV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_sale_v1_discriminator: 1, - amount: 1, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateSaleV1InstructionArgs { + pub amount: u64, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateSaleV1Builder { @@ -300,6 +306,7 @@ impl DelegateSaleV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -333,8 +340,12 @@ impl DelegateSaleV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateSaleV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -370,6 +381,8 @@ pub struct DelegateSaleV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateSaleV1InstructionArgs, } impl<'a> DelegateSaleV1Cpi<'a> { @@ -382,8 +395,6 @@ impl<'a> DelegateSaleV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateSaleV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -392,7 +403,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -411,7 +422,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -422,7 +433,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -457,7 +468,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -468,7 +479,7 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -479,15 +490,18 @@ impl<'a> DelegateSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateSaleV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -677,6 +691,7 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -690,6 +705,11 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateSaleV1Cpi<'a> { + let args = DelegateSaleV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateSaleV1Cpi { __program: self.instruction.__program, @@ -726,6 +746,7 @@ impl<'a> DelegateSaleV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_staking_v1.rs b/clients/rust/src/generated/instructions/delegate_staking_v1.rs index 5eb5cf61..06e081f8 100644 --- a/clients/rust/src/generated/instructions/delegate_staking_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_staking_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateStakingV1 { impl DelegateStakingV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateStakingV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateStakingV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -116,7 +117,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -127,7 +128,7 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -138,38 +139,45 @@ impl DelegateStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateStakingV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateStakingV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateStakingV1InstructionData { discriminator: u8, delegate_staking_v1_discriminator: u8, - pub amount: u64, - pub authorization_data: Option, } -impl DelegateStakingV1InstructionArgs { - pub fn new() -> Self { +impl DelegateStakingV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_staking_v1_discriminator: 5, - amount: 1, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateStakingV1InstructionArgs { + pub amount: u64, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateStakingV1Builder { @@ -300,6 +308,7 @@ impl DelegateStakingV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -333,8 +342,12 @@ impl DelegateStakingV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateStakingV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -370,6 +383,8 @@ pub struct DelegateStakingV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateStakingV1InstructionArgs, } impl<'a> DelegateStakingV1Cpi<'a> { @@ -382,8 +397,6 @@ impl<'a> DelegateStakingV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateStakingV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -392,7 +405,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -411,7 +424,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -422,7 +435,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -457,7 +470,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -468,7 +481,7 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -479,15 +492,20 @@ impl<'a> DelegateStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateStakingV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -677,6 +695,7 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -690,6 +709,11 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateStakingV1Cpi<'a> { + let args = DelegateStakingV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateStakingV1Cpi { __program: self.instruction.__program, @@ -726,6 +750,7 @@ impl<'a> DelegateStakingV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_standard_v1.rs b/clients/rust/src/generated/instructions/delegate_standard_v1.rs index 0183dc0f..6b05b3ea 100644 --- a/clients/rust/src/generated/instructions/delegate_standard_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_standard_v1.rs @@ -42,9 +42,10 @@ pub struct DelegateStandardV1 { impl DelegateStandardV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateStandardV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateStandardV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +54,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +73,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +84,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +116,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +127,7 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,36 +138,44 @@ impl DelegateStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateStandardV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateStandardV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateStandardV1InstructionData { discriminator: u8, delegate_standard_v1_discriminator: u8, - pub amount: u64, } -impl DelegateStandardV1InstructionArgs { - pub fn new() -> Self { +impl DelegateStandardV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_standard_v1_discriminator: 6, - amount: 1, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateStandardV1InstructionArgs { + pub amount: u64, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateStandardV1Builder { @@ -296,6 +305,7 @@ impl DelegateStandardV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -323,8 +333,11 @@ impl DelegateStandardV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateStandardV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -360,6 +373,8 @@ pub struct DelegateStandardV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateStandardV1InstructionArgs, } impl<'a> DelegateStandardV1Cpi<'a> { @@ -372,8 +387,6 @@ impl<'a> DelegateStandardV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateStandardV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -382,7 +395,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -401,7 +414,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -412,7 +425,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -447,7 +460,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -458,7 +471,7 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -469,15 +482,20 @@ impl<'a> DelegateStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateStandardV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -666,6 +684,7 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -673,6 +692,10 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateStandardV1Cpi<'a> { + let args = DelegateStandardV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + }; + DelegateStandardV1Cpi { __program: self.instruction.__program, @@ -709,6 +732,7 @@ impl<'a> DelegateStandardV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs index 3bbd50f1..97b39ffb 100644 --- a/clients/rust/src/generated/instructions/delegate_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_transfer_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateTransferV1 { impl DelegateTransferV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateTransferV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateTransferV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -116,7 +117,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -127,7 +128,7 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -138,38 +139,45 @@ impl DelegateTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateTransferV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateTransferV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateTransferV1InstructionData { discriminator: u8, delegate_transfer_v1_discriminator: u8, - pub amount: u64, - pub authorization_data: Option, } -impl DelegateTransferV1InstructionArgs { - pub fn new() -> Self { +impl DelegateTransferV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_transfer_v1_discriminator: 2, - amount: 1, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateTransferV1InstructionArgs { + pub amount: u64, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateTransferV1Builder { @@ -300,6 +308,7 @@ impl DelegateTransferV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -333,8 +342,12 @@ impl DelegateTransferV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateTransferV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -370,6 +383,8 @@ pub struct DelegateTransferV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateTransferV1InstructionArgs, } impl<'a> DelegateTransferV1Cpi<'a> { @@ -382,8 +397,6 @@ impl<'a> DelegateTransferV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateTransferV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -392,7 +405,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -411,7 +424,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -422,7 +435,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -457,7 +470,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -468,7 +481,7 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -479,15 +492,20 @@ impl<'a> DelegateTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateTransferV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -677,6 +695,7 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -690,6 +709,11 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateTransferV1Cpi<'a> { + let args = DelegateTransferV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateTransferV1Cpi { __program: self.instruction.__program, @@ -726,6 +750,7 @@ impl<'a> DelegateTransferV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/delegate_utility_v1.rs b/clients/rust/src/generated/instructions/delegate_utility_v1.rs index 409d30f5..4b1070dd 100644 --- a/clients/rust/src/generated/instructions/delegate_utility_v1.rs +++ b/clients/rust/src/generated/instructions/delegate_utility_v1.rs @@ -43,9 +43,10 @@ pub struct DelegateUtilityV1 { impl DelegateUtilityV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DelegateUtilityV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: DelegateUtilityV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -54,7 +55,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -84,7 +85,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -116,7 +117,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -127,7 +128,7 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -138,38 +139,45 @@ impl DelegateUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateUtilityV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DelegateUtilityV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DelegateUtilityV1InstructionData { discriminator: u8, delegate_utility_v1_discriminator: u8, - pub amount: u64, - pub authorization_data: Option, } -impl DelegateUtilityV1InstructionArgs { - pub fn new() -> Self { +impl DelegateUtilityV1InstructionData { + fn new() -> Self { Self { discriminator: 44, delegate_utility_v1_discriminator: 4, - amount: 1, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct DelegateUtilityV1InstructionArgs { + pub amount: u64, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct DelegateUtilityV1Builder { @@ -300,6 +308,7 @@ impl DelegateUtilityV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -333,8 +342,12 @@ impl DelegateUtilityV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = DelegateUtilityV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -370,6 +383,8 @@ pub struct DelegateUtilityV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: DelegateUtilityV1InstructionArgs, } impl<'a> DelegateUtilityV1Cpi<'a> { @@ -382,8 +397,6 @@ impl<'a> DelegateUtilityV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DelegateUtilityV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -392,7 +405,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -411,7 +424,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -422,7 +435,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -457,7 +470,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -468,7 +481,7 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -479,15 +492,20 @@ impl<'a> DelegateUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = DelegateUtilityV1InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -677,6 +695,7 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -690,6 +709,11 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> DelegateUtilityV1Cpi<'a> { + let args = DelegateUtilityV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + authorization_data: self.instruction.authorization_data.clone(), + }; + DelegateUtilityV1Cpi { __program: self.instruction.__program, @@ -726,6 +750,7 @@ impl<'a> DelegateUtilityV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs index da7c922c..9dd29f8d 100644 --- a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs +++ b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs @@ -47,8 +47,6 @@ pub struct DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { impl DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs::new(); - let mut accounts = Vec::with_capacity(16); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -114,26 +112,29 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionData { discriminator: u8, } -impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs { - pub fn new() -> Self { +impl DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionData { + fn new() -> Self { Self { discriminator: 3 } } } @@ -355,8 +356,6 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionArgs::new(); - let mut accounts = Vec::with_capacity(16); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -425,15 +424,18 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(16 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/freeze_delegated_account.rs b/clients/rust/src/generated/instructions/freeze_delegated_account.rs index 2bb47913..5a7ac7c5 100644 --- a/clients/rust/src/generated/instructions/freeze_delegated_account.rs +++ b/clients/rust/src/generated/instructions/freeze_delegated_account.rs @@ -25,8 +25,6 @@ pub struct FreezeDelegatedAccount { impl FreezeDelegatedAccount { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = FreezeDelegatedAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(5); accounts.push(solana_program::instruction::AccountMeta::new( self.delegate, @@ -47,22 +45,25 @@ impl FreezeDelegatedAccount { self.token_program, false, )); + let data = FreezeDelegatedAccountInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct FreezeDelegatedAccountInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct FreezeDelegatedAccountInstructionData { discriminator: u8, } -impl FreezeDelegatedAccountInstructionArgs { - pub fn new() -> Self { +impl FreezeDelegatedAccountInstructionData { + fn new() -> Self { Self { discriminator: 26 } } } @@ -153,8 +154,6 @@ impl<'a> FreezeDelegatedAccountCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = FreezeDelegatedAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(5); accounts.push(solana_program::instruction::AccountMeta::new( *self.delegate.key, @@ -176,11 +175,14 @@ impl<'a> FreezeDelegatedAccountCpi<'a> { *self.token_program.key, false, )); + let data = FreezeDelegatedAccountInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(5 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/lock_v1.rs b/clients/rust/src/generated/instructions/lock_v1.rs index 2a62b745..494f1baf 100644 --- a/clients/rust/src/generated/instructions/lock_v1.rs +++ b/clients/rust/src/generated/instructions/lock_v1.rs @@ -41,9 +41,10 @@ pub struct LockV1 { impl LockV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = LockV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: LockV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(13); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -56,7 +57,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -76,7 +77,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -87,7 +88,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -109,7 +110,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +121,7 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,36 +132,42 @@ impl LockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = LockV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct LockV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct LockV1InstructionData { discriminator: u8, lock_v1_discriminator: u8, - pub authorization_data: Option, } -impl LockV1InstructionArgs { - pub fn new() -> Self { +impl LockV1InstructionData { + fn new() -> Self { Self { discriminator: 46, lock_v1_discriminator: 0, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct LockV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct LockV1Builder { @@ -307,8 +314,11 @@ impl LockV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = LockV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -342,6 +352,8 @@ pub struct LockV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: LockV1InstructionArgs, } impl<'a> LockV1Cpi<'a> { @@ -354,8 +366,6 @@ impl<'a> LockV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = LockV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(13); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -368,7 +378,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -391,7 +401,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -402,7 +412,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -425,7 +435,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -436,7 +446,7 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -447,15 +457,18 @@ impl<'a> LockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = LockV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(13 + 1); account_infos.push(self.__program.clone()); @@ -641,6 +654,10 @@ impl<'a> LockV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> LockV1Cpi<'a> { + let args = LockV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + LockV1Cpi { __program: self.instruction.__program, @@ -675,6 +692,7 @@ impl<'a> LockV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/migrate.rs b/clients/rust/src/generated/instructions/migrate.rs index 4918cc9c..cf31f2ab 100644 --- a/clients/rust/src/generated/instructions/migrate.rs +++ b/clients/rust/src/generated/instructions/migrate.rs @@ -45,8 +45,6 @@ pub struct Migrate { impl Migrate { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = MigrateInstructionArgs::new(); - let mut accounts = Vec::with_capacity(15); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -104,7 +102,7 @@ impl Migrate { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,26 +113,27 @@ impl Migrate { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = MigrateInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct MigrateInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct MigrateInstructionData { discriminator: u8, } -impl MigrateInstructionArgs { - pub fn new() -> Self { +impl MigrateInstructionData { + fn new() -> Self { Self { discriminator: 48 } } } @@ -351,8 +350,6 @@ impl<'a> MigrateCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = MigrateInstructionArgs::new(); - let mut accounts = Vec::with_capacity(15); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -413,7 +410,7 @@ impl<'a> MigrateCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,15 +421,16 @@ impl<'a> MigrateCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = MigrateInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(15 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs index 9761a417..1677cf2e 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs @@ -105,37 +105,41 @@ impl MintNewEditionFromMasterEditionViaToken { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = MintNewEditionFromMasterEditionViaTokenInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct MintNewEditionFromMasterEditionViaTokenInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct MintNewEditionFromMasterEditionViaTokenInstructionData { discriminator: u8, - pub mint_new_edition_from_master_edition_via_token_args: - MintNewEditionFromMasterEditionViaTokenArgs, } -impl MintNewEditionFromMasterEditionViaTokenInstructionArgs { - pub fn new( - mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, - ) -> Self { - Self { - discriminator: 11, - mint_new_edition_from_master_edition_via_token_args, - } +impl MintNewEditionFromMasterEditionViaTokenInstructionData { + fn new() -> Self { + Self { discriminator: 11 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct MintNewEditionFromMasterEditionViaTokenInstructionArgs { + pub mint_new_edition_from_master_edition_via_token_args: + MintNewEditionFromMasterEditionViaTokenArgs, +} + /// Instruction builder. #[derive(Default)] pub struct MintNewEditionFromMasterEditionViaTokenBuilder { @@ -295,11 +299,12 @@ impl MintNewEditionFromMasterEditionViaTokenBuilder { .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), rent: self.rent, }; - let args = MintNewEditionFromMasterEditionViaTokenInstructionArgs::new( - self.mint_new_edition_from_master_edition_via_token_args + let args = MintNewEditionFromMasterEditionViaTokenInstructionArgs { + mint_new_edition_from_master_edition_via_token_args: self + .mint_new_edition_from_master_edition_via_token_args .clone() .expect("mint_new_edition_from_master_edition_via_token_args is not set"), - ); + }; accounts.instruction(args) } @@ -410,15 +415,20 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = MintNewEditionFromMasterEditionViaTokenInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); @@ -609,12 +619,13 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> MintNewEditionFromMasterEditionViaTokenCpi<'a> { - let args = MintNewEditionFromMasterEditionViaTokenInstructionArgs::new( - self.instruction + let args = MintNewEditionFromMasterEditionViaTokenInstructionArgs { + mint_new_edition_from_master_edition_via_token_args: self + .instruction .mint_new_edition_from_master_edition_via_token_args .clone() .expect("mint_new_edition_from_master_edition_via_token_args is not set"), - ); + }; MintNewEditionFromMasterEditionViaTokenCpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs index 23a95fa6..fe3ee777 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs @@ -122,37 +122,41 @@ impl MintNewEditionFromMasterEditionViaVaultProxy { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = MintNewEditionFromMasterEditionViaVaultProxyInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct MintNewEditionFromMasterEditionViaVaultProxyInstructionData { discriminator: u8, - pub mint_new_edition_from_master_edition_via_token_args: - MintNewEditionFromMasterEditionViaTokenArgs, } -impl MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { - pub fn new( - mint_new_edition_from_master_edition_via_token_args: MintNewEditionFromMasterEditionViaTokenArgs, - ) -> Self { - Self { - discriminator: 13, - mint_new_edition_from_master_edition_via_token_args, - } +impl MintNewEditionFromMasterEditionViaVaultProxyInstructionData { + fn new() -> Self { + Self { discriminator: 13 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { + pub mint_new_edition_from_master_edition_via_token_args: + MintNewEditionFromMasterEditionViaTokenArgs, +} + /// Instruction builder. #[derive(Default)] pub struct MintNewEditionFromMasterEditionViaVaultProxyBuilder { @@ -349,11 +353,12 @@ impl MintNewEditionFromMasterEditionViaVaultProxyBuilder { .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), rent: self.rent, }; - let args = MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs::new( - self.mint_new_edition_from_master_edition_via_token_args + let args = MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { + mint_new_edition_from_master_edition_via_token_args: self + .mint_new_edition_from_master_edition_via_token_args .clone() .expect("mint_new_edition_from_master_edition_via_token_args is not set"), - ); + }; accounts.instruction(args) } @@ -482,15 +487,20 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = MintNewEditionFromMasterEditionViaVaultProxyInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(17 + 1); account_infos.push(self.__program.clone()); @@ -711,12 +721,13 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { - let args = MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs::new( - self.instruction + let args = MintNewEditionFromMasterEditionViaVaultProxyInstructionArgs { + mint_new_edition_from_master_edition_via_token_args: self + .instruction .mint_new_edition_from_master_edition_via_token_args .clone() .expect("mint_new_edition_from_master_edition_via_token_args is not set"), - ); + }; MintNewEditionFromMasterEditionViaVaultProxyCpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/mint_v1.rs b/clients/rust/src/generated/instructions/mint_v1.rs index e9917299..4e7acad6 100644 --- a/clients/rust/src/generated/instructions/mint_v1.rs +++ b/clients/rust/src/generated/instructions/mint_v1.rs @@ -45,9 +45,10 @@ pub struct MintV1 { impl MintV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = MintV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: MintV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(15); accounts.push(solana_program::instruction::AccountMeta::new( self.token, false, @@ -59,7 +60,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -74,7 +75,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -85,7 +86,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -103,7 +104,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -133,7 +134,7 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -144,38 +145,43 @@ impl MintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = MintV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct MintV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct MintV1InstructionData { discriminator: u8, mint_v1_discriminator: u8, - pub amount: u64, - pub authorization_data: Option, } -impl MintV1InstructionArgs { - pub fn new() -> Self { +impl MintV1InstructionData { + fn new() -> Self { Self { discriminator: 43, mint_v1_discriminator: 0, - amount: 1, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct MintV1InstructionArgs { + pub amount: u64, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct MintV1Builder { @@ -316,6 +322,7 @@ impl MintV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -354,8 +361,12 @@ impl MintV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = MintV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -393,6 +404,8 @@ pub struct MintV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: MintV1InstructionArgs, } impl<'a> MintV1Cpi<'a> { @@ -405,8 +418,6 @@ impl<'a> MintV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = MintV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(15); accounts.push(solana_program::instruction::AccountMeta::new( *self.token.key, @@ -419,7 +430,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -434,7 +445,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -445,7 +456,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -464,7 +475,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -495,7 +506,7 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -506,15 +517,18 @@ impl<'a> MintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = MintV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(15 + 1); account_infos.push(self.__program.clone()); @@ -715,6 +729,7 @@ impl<'a> MintV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -728,6 +743,11 @@ impl<'a> MintV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> MintV1Cpi<'a> { + let args = MintV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + authorization_data: self.instruction.authorization_data.clone(), + }; + MintV1Cpi { __program: self.instruction.__program, @@ -772,6 +792,7 @@ impl<'a> MintV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/print_v1.rs b/clients/rust/src/generated/instructions/print_v1.rs index 1a870f11..2354e46c 100644 --- a/clients/rust/src/generated/instructions/print_v1.rs +++ b/clients/rust/src/generated/instructions/print_v1.rs @@ -86,7 +86,7 @@ impl PrintV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -133,32 +133,38 @@ impl PrintV1 { self.system_program, false, )); + let mut data = PrintV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct PrintV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct PrintV1InstructionData { discriminator: u8, print_v1_discriminator: u8, - pub edition_arg: u64, } -impl PrintV1InstructionArgs { - pub fn new(edition_arg: u64) -> Self { +impl PrintV1InstructionData { + fn new() -> Self { Self { discriminator: 55, print_v1_discriminator: 0, - edition_arg, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct PrintV1InstructionArgs { + pub edition_arg: u64, +} + /// Instruction builder. #[derive(Default)] pub struct PrintV1Builder { @@ -382,8 +388,9 @@ impl PrintV1Builder { .system_program .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), }; - let args = - PrintV1InstructionArgs::new(self.edition_arg.clone().expect("edition_arg is not set")); + let args = PrintV1InstructionArgs { + edition_arg: self.edition_arg.clone().expect("edition_arg is not set"), + }; accounts.instruction(args) } @@ -475,7 +482,7 @@ impl<'a> PrintV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -523,11 +530,14 @@ impl<'a> PrintV1Cpi<'a> { *self.system_program.key, false, )); + let mut data = PrintV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(18 + 1); account_infos.push(self.__program.clone()); @@ -758,12 +768,13 @@ impl<'a> PrintV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> PrintV1Cpi<'a> { - let args = PrintV1InstructionArgs::new( - self.instruction + let args = PrintV1InstructionArgs { + edition_arg: self + .instruction .edition_arg .clone() .expect("edition_arg is not set"), - ); + }; PrintV1Cpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/puff_metadata.rs b/clients/rust/src/generated/instructions/puff_metadata.rs index 6d150e4d..84c62d4e 100644 --- a/clients/rust/src/generated/instructions/puff_metadata.rs +++ b/clients/rust/src/generated/instructions/puff_metadata.rs @@ -17,29 +17,28 @@ pub struct PuffMetadata { impl PuffMetadata { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = PuffMetadataInstructionArgs::new(); - let mut accounts = Vec::with_capacity(1); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, false, )); + let data = PuffMetadataInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct PuffMetadataInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct PuffMetadataInstructionData { discriminator: u8, } -impl PuffMetadataInstructionArgs { - pub fn new() -> Self { +impl PuffMetadataInstructionData { + fn new() -> Self { Self { discriminator: 14 } } } @@ -88,18 +87,17 @@ impl<'a> PuffMetadataCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = PuffMetadataInstructionArgs::new(); - let mut accounts = Vec::with_capacity(1); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, false, )); + let data = PuffMetadataInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(1 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/remove_creator_verification.rs b/clients/rust/src/generated/instructions/remove_creator_verification.rs index a3e1b6ad..d3acc793 100644 --- a/clients/rust/src/generated/instructions/remove_creator_verification.rs +++ b/clients/rust/src/generated/instructions/remove_creator_verification.rs @@ -19,8 +19,6 @@ pub struct RemoveCreatorVerification { impl RemoveCreatorVerification { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RemoveCreatorVerificationInstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -30,22 +28,25 @@ impl RemoveCreatorVerification { self.creator, true, )); + let data = RemoveCreatorVerificationInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RemoveCreatorVerificationInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RemoveCreatorVerificationInstructionData { discriminator: u8, } -impl RemoveCreatorVerificationInstructionArgs { - pub fn new() -> Self { +impl RemoveCreatorVerificationInstructionData { + fn new() -> Self { Self { discriminator: 28 } } } @@ -104,8 +105,6 @@ impl<'a> RemoveCreatorVerificationCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RemoveCreatorVerificationInstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -115,11 +114,14 @@ impl<'a> RemoveCreatorVerificationCpi<'a> { *self.creator.key, true, )); + let data = RemoveCreatorVerificationInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(2 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs index 46abf519..11b75b34 100644 --- a/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_authority_item_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeAuthorityItemV1 { impl RevokeAuthorityItemV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeAuthorityItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeAuthorityItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,30 @@ impl RevokeAuthorityItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeAuthorityItemV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeAuthorityItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeAuthorityItemV1InstructionData { discriminator: u8, revoke_authority_item_v1_discriminator: u8, } -impl RevokeAuthorityItemV1InstructionArgs { - pub fn new() -> Self { +impl RevokeAuthorityItemV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_authority_item_v1_discriminator: 10, @@ -370,8 +371,6 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeAuthorityItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +379,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +398,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +409,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +423,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +450,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +461,7 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +472,18 @@ impl<'a> RevokeAuthorityItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeAuthorityItemV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_collection_authority.rs b/clients/rust/src/generated/instructions/revoke_collection_authority.rs index 96c46d50..7c62381f 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_authority.rs @@ -25,8 +25,6 @@ pub struct RevokeCollectionAuthority { impl RevokeCollectionAuthority { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeCollectionAuthorityInstructionArgs::new(); - let mut accounts = Vec::with_capacity(5); accounts.push(solana_program::instruction::AccountMeta::new( self.collection_authority_record, @@ -47,22 +45,25 @@ impl RevokeCollectionAuthority { accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.mint, false, )); + let data = RevokeCollectionAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeCollectionAuthorityInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeCollectionAuthorityInstructionData { discriminator: u8, } -impl RevokeCollectionAuthorityInstructionArgs { - pub fn new() -> Self { +impl RevokeCollectionAuthorityInstructionData { + fn new() -> Self { Self { discriminator: 24 } } } @@ -164,8 +165,6 @@ impl<'a> RevokeCollectionAuthorityCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeCollectionAuthorityInstructionArgs::new(); - let mut accounts = Vec::with_capacity(5); accounts.push(solana_program::instruction::AccountMeta::new( *self.collection_authority_record.key, @@ -187,11 +186,14 @@ impl<'a> RevokeCollectionAuthorityCpi<'a> { *self.mint.key, false, )); + let data = RevokeCollectionAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(5 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs index 2ea564d8..4685d667 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_item_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeCollectionItemV1 { impl RevokeCollectionItemV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeCollectionItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeCollectionItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,30 @@ impl RevokeCollectionItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeCollectionItemV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeCollectionItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeCollectionItemV1InstructionData { discriminator: u8, revoke_collection_item_v1_discriminator: u8, } -impl RevokeCollectionItemV1InstructionArgs { - pub fn new() -> Self { +impl RevokeCollectionItemV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_collection_item_v1_discriminator: 12, @@ -370,8 +371,6 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeCollectionItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +379,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +398,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +409,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +423,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +450,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +461,7 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +472,18 @@ impl<'a> RevokeCollectionItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeCollectionItemV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_collection_v1.rs b/clients/rust/src/generated/instructions/revoke_collection_v1.rs index 768a771d..596210e8 100644 --- a/clients/rust/src/generated/instructions/revoke_collection_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_collection_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeCollectionV1 { impl RevokeCollectionV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeCollectionV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,30 @@ impl RevokeCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeCollectionV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeCollectionV1InstructionData { discriminator: u8, revoke_collection_v1_discriminator: u8, } -impl RevokeCollectionV1InstructionArgs { - pub fn new() -> Self { +impl RevokeCollectionV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_collection_v1_discriminator: 0, @@ -370,8 +371,6 @@ impl<'a> RevokeCollectionV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +379,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +398,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +409,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +423,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +450,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +461,7 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +472,18 @@ impl<'a> RevokeCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs index 9839ac10..269b3fbd 100644 --- a/clients/rust/src/generated/instructions/revoke_data_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_item_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeDataItemV1 { impl RevokeDataItemV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeDataItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeDataItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,28 @@ impl RevokeDataItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeDataItemV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeDataItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeDataItemV1InstructionData { discriminator: u8, revoke_data_item_v1_discriminator: u8, } -impl RevokeDataItemV1InstructionArgs { - pub fn new() -> Self { +impl RevokeDataItemV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_data_item_v1_discriminator: 11, @@ -370,8 +369,6 @@ impl<'a> RevokeDataItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeDataItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +377,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +396,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +407,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +421,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +448,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +459,7 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +470,16 @@ impl<'a> RevokeDataItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeDataItemV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_data_v1.rs b/clients/rust/src/generated/instructions/revoke_data_v1.rs index cfdc62bf..85ebbd23 100644 --- a/clients/rust/src/generated/instructions/revoke_data_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_data_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeDataV1 { impl RevokeDataV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeDataV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeDataV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,28 @@ impl RevokeDataV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeDataV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeDataV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeDataV1InstructionData { discriminator: u8, revoke_data_v1_discriminator: u8, } -impl RevokeDataV1InstructionArgs { - pub fn new() -> Self { +impl RevokeDataV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_data_v1_discriminator: 3, @@ -370,8 +369,6 @@ impl<'a> RevokeDataV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeDataV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +377,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +396,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +407,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +421,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +448,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +459,7 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +470,16 @@ impl<'a> RevokeDataV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeDataV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs index c9c19b5f..65c062af 100644 --- a/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_locked_transfer_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeLockedTransferV1 { impl RevokeLockedTransferV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeLockedTransferV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,30 @@ impl RevokeLockedTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeLockedTransferV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeLockedTransferV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeLockedTransferV1InstructionData { discriminator: u8, revoke_locked_transfer_v1_discriminator: u8, } -impl RevokeLockedTransferV1InstructionArgs { - pub fn new() -> Self { +impl RevokeLockedTransferV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_locked_transfer_v1_discriminator: 7, @@ -364,8 +365,6 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeLockedTransferV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +373,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +392,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +403,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +438,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +449,7 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +460,18 @@ impl<'a> RevokeLockedTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeLockedTransferV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_migration_v1.rs b/clients/rust/src/generated/instructions/revoke_migration_v1.rs index e934b67f..eb40149f 100644 --- a/clients/rust/src/generated/instructions/revoke_migration_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_migration_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeMigrationV1 { impl RevokeMigrationV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeMigrationV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,30 @@ impl RevokeMigrationV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeMigrationV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeMigrationV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeMigrationV1InstructionData { discriminator: u8, revoke_migration_v1_discriminator: u8, } -impl RevokeMigrationV1InstructionArgs { - pub fn new() -> Self { +impl RevokeMigrationV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_migration_v1_discriminator: 9, @@ -364,8 +365,6 @@ impl<'a> RevokeMigrationV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeMigrationV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +373,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +392,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +403,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +438,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +449,7 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +460,18 @@ impl<'a> RevokeMigrationV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeMigrationV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs index e871925b..ac85c71f 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_item_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeProgrammableConfigItemV1 { impl RevokeProgrammableConfigItemV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeProgrammableConfigItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeProgrammableConfigItemV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,30 @@ impl RevokeProgrammableConfigItemV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeProgrammableConfigItemV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeProgrammableConfigItemV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeProgrammableConfigItemV1InstructionData { discriminator: u8, revoke_programmable_config_item_v1_discriminator: u8, } -impl RevokeProgrammableConfigItemV1InstructionArgs { - pub fn new() -> Self { +impl RevokeProgrammableConfigItemV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_programmable_config_item_v1_discriminator: 13, @@ -370,8 +371,6 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeProgrammableConfigItemV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +379,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +398,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +409,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +423,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +450,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +461,7 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +472,18 @@ impl<'a> RevokeProgrammableConfigItemV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeProgrammableConfigItemV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs index 138c9508..4539704b 100644 --- a/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_programmable_config_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeProgrammableConfigV1 { impl RevokeProgrammableConfigV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeProgrammableConfigV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,7 +92,7 @@ impl RevokeProgrammableConfigV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +118,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,7 +129,7 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -142,27 +140,30 @@ impl RevokeProgrammableConfigV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeProgrammableConfigV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeProgrammableConfigV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeProgrammableConfigV1InstructionData { discriminator: u8, revoke_programmable_config_v1_discriminator: u8, } -impl RevokeProgrammableConfigV1InstructionArgs { - pub fn new() -> Self { +impl RevokeProgrammableConfigV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_programmable_config_v1_discriminator: 8, @@ -370,8 +371,6 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeProgrammableConfigV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -380,7 +379,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +398,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,7 +409,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -424,7 +423,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -451,7 +450,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -462,7 +461,7 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,15 +472,18 @@ impl<'a> RevokeProgrammableConfigV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeProgrammableConfigV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_sale_v1.rs b/clients/rust/src/generated/instructions/revoke_sale_v1.rs index dd8aba6f..8c917e73 100644 --- a/clients/rust/src/generated/instructions/revoke_sale_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_sale_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeSaleV1 { impl RevokeSaleV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeSaleV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,28 @@ impl RevokeSaleV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeSaleV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeSaleV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeSaleV1InstructionData { discriminator: u8, revoke_sale_v1_discriminator: u8, } -impl RevokeSaleV1InstructionArgs { - pub fn new() -> Self { +impl RevokeSaleV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_sale_v1_discriminator: 1, @@ -364,8 +363,6 @@ impl<'a> RevokeSaleV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeSaleV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +371,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +390,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +401,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +436,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +447,7 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +458,16 @@ impl<'a> RevokeSaleV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeSaleV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_staking_v1.rs b/clients/rust/src/generated/instructions/revoke_staking_v1.rs index ba83de73..803c22a5 100644 --- a/clients/rust/src/generated/instructions/revoke_staking_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_staking_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeStakingV1 { impl RevokeStakingV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeStakingV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,28 @@ impl RevokeStakingV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeStakingV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeStakingV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeStakingV1InstructionData { discriminator: u8, revoke_staking_v1_discriminator: u8, } -impl RevokeStakingV1InstructionArgs { - pub fn new() -> Self { +impl RevokeStakingV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_staking_v1_discriminator: 5, @@ -364,8 +363,6 @@ impl<'a> RevokeStakingV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeStakingV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +371,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +390,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +401,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +436,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +447,7 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +458,16 @@ impl<'a> RevokeStakingV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeStakingV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_standard_v1.rs b/clients/rust/src/generated/instructions/revoke_standard_v1.rs index 5bdefeec..34f468ee 100644 --- a/clients/rust/src/generated/instructions/revoke_standard_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_standard_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeStandardV1 { impl RevokeStandardV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeStandardV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,28 @@ impl RevokeStandardV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeStandardV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeStandardV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeStandardV1InstructionData { discriminator: u8, revoke_standard_v1_discriminator: u8, } -impl RevokeStandardV1InstructionArgs { - pub fn new() -> Self { +impl RevokeStandardV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_standard_v1_discriminator: 6, @@ -364,8 +363,6 @@ impl<'a> RevokeStandardV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeStandardV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +371,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +390,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +401,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +436,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +447,7 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +458,16 @@ impl<'a> RevokeStandardV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeStandardV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs index 58fab539..7b763235 100644 --- a/clients/rust/src/generated/instructions/revoke_transfer_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_transfer_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeTransferV1 { impl RevokeTransferV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeTransferV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,28 @@ impl RevokeTransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeTransferV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeTransferV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeTransferV1InstructionData { discriminator: u8, revoke_transfer_v1_discriminator: u8, } -impl RevokeTransferV1InstructionArgs { - pub fn new() -> Self { +impl RevokeTransferV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_transfer_v1_discriminator: 2, @@ -364,8 +363,6 @@ impl<'a> RevokeTransferV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeTransferV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +371,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +390,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +401,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +436,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +447,7 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +458,16 @@ impl<'a> RevokeTransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeTransferV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_use_authority.rs b/clients/rust/src/generated/instructions/revoke_use_authority.rs index 446d88f0..71172982 100644 --- a/clients/rust/src/generated/instructions/revoke_use_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_use_authority.rs @@ -33,8 +33,6 @@ pub struct RevokeUseAuthority { impl RevokeUseAuthority { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeUseAuthorityInstructionArgs::new(); - let mut accounts = Vec::with_capacity(9); accounts.push(solana_program::instruction::AccountMeta::new( self.use_authority_record, @@ -71,26 +69,29 @@ impl RevokeUseAuthority { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeUseAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeUseAuthorityInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeUseAuthorityInstructionData { discriminator: u8, } -impl RevokeUseAuthorityInstructionArgs { - pub fn new() -> Self { +impl RevokeUseAuthorityInstructionData { + fn new() -> Self { Self { discriminator: 21 } } } @@ -234,8 +235,6 @@ impl<'a> RevokeUseAuthorityCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeUseAuthorityInstructionArgs::new(); - let mut accounts = Vec::with_capacity(9); accounts.push(solana_program::instruction::AccountMeta::new( *self.use_authority_record.key, @@ -275,15 +274,18 @@ impl<'a> RevokeUseAuthorityCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeUseAuthorityInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(9 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/revoke_utility_v1.rs b/clients/rust/src/generated/instructions/revoke_utility_v1.rs index 9113f2f6..01d87bf1 100644 --- a/clients/rust/src/generated/instructions/revoke_utility_v1.rs +++ b/clients/rust/src/generated/instructions/revoke_utility_v1.rs @@ -43,8 +43,6 @@ pub struct RevokeUtilityV1 { impl RevokeUtilityV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = RevokeUtilityV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -53,7 +51,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -72,7 +70,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -83,7 +81,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -115,7 +113,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -126,7 +124,7 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,27 +135,28 @@ impl RevokeUtilityV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeUtilityV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct RevokeUtilityV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct RevokeUtilityV1InstructionData { discriminator: u8, revoke_utility_v1_discriminator: u8, } -impl RevokeUtilityV1InstructionArgs { - pub fn new() -> Self { +impl RevokeUtilityV1InstructionData { + fn new() -> Self { Self { discriminator: 45, revoke_utility_v1_discriminator: 4, @@ -364,8 +363,6 @@ impl<'a> RevokeUtilityV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = RevokeUtilityV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(14); if let Some(delegate_record) = self.delegate_record { accounts.push(solana_program::instruction::AccountMeta::new( @@ -374,7 +371,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -393,7 +390,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -404,7 +401,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -439,7 +436,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +447,7 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -461,15 +458,16 @@ impl<'a> RevokeUtilityV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = RevokeUtilityV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(14 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/set_and_verify_collection.rs b/clients/rust/src/generated/instructions/set_and_verify_collection.rs index f572c578..0d5a583d 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_collection.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_collection.rs @@ -31,8 +31,6 @@ pub struct SetAndVerifyCollection { impl SetAndVerifyCollection { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = SetAndVerifyCollectionInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -68,26 +66,29 @@ impl SetAndVerifyCollection { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = SetAndVerifyCollectionInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct SetAndVerifyCollectionInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct SetAndVerifyCollectionInstructionData { discriminator: u8, } -impl SetAndVerifyCollectionInstructionArgs { - pub fn new() -> Self { +impl SetAndVerifyCollectionInstructionData { + fn new() -> Self { Self { discriminator: 25 } } } @@ -226,8 +227,6 @@ impl<'a> SetAndVerifyCollectionCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = SetAndVerifyCollectionInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -264,15 +263,18 @@ impl<'a> SetAndVerifyCollectionCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = SetAndVerifyCollectionInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(8 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs index bee2748d..82c1404d 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs @@ -31,8 +31,6 @@ pub struct SetAndVerifySizedCollectionItem { impl SetAndVerifySizedCollectionItem { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = SetAndVerifySizedCollectionItemInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -68,26 +66,29 @@ impl SetAndVerifySizedCollectionItem { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = SetAndVerifySizedCollectionItemInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct SetAndVerifySizedCollectionItemInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct SetAndVerifySizedCollectionItemInstructionData { discriminator: u8, } -impl SetAndVerifySizedCollectionItemInstructionArgs { - pub fn new() -> Self { +impl SetAndVerifySizedCollectionItemInstructionData { + fn new() -> Self { Self { discriminator: 32 } } } @@ -226,8 +227,6 @@ impl<'a> SetAndVerifySizedCollectionItemCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = SetAndVerifySizedCollectionItemInstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -264,15 +263,18 @@ impl<'a> SetAndVerifySizedCollectionItemCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = SetAndVerifySizedCollectionItemInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(8 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/set_collection_size.rs b/clients/rust/src/generated/instructions/set_collection_size.rs index 09935087..fabe885a 100644 --- a/clients/rust/src/generated/instructions/set_collection_size.rs +++ b/clients/rust/src/generated/instructions/set_collection_size.rs @@ -47,34 +47,40 @@ impl SetCollectionSize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = SetCollectionSizeInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct SetCollectionSizeInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct SetCollectionSizeInstructionData { discriminator: u8, - pub set_collection_size_args: SetCollectionSizeArgs, } -impl SetCollectionSizeInstructionArgs { - pub fn new(set_collection_size_args: SetCollectionSizeArgs) -> Self { - Self { - discriminator: 34, - set_collection_size_args, - } +impl SetCollectionSizeInstructionData { + fn new() -> Self { + Self { discriminator: 34 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct SetCollectionSizeInstructionArgs { + pub set_collection_size_args: SetCollectionSizeArgs, +} + /// Instruction builder. #[derive(Default)] pub struct SetCollectionSizeBuilder { @@ -146,11 +152,12 @@ impl SetCollectionSizeBuilder { collection_mint: self.collection_mint.expect("collection_mint is not set"), collection_authority_record: self.collection_authority_record, }; - let args = SetCollectionSizeInstructionArgs::new( - self.set_collection_size_args + let args = SetCollectionSizeInstructionArgs { + set_collection_size_args: self + .set_collection_size_args .clone() .expect("set_collection_size_args is not set"), - ); + }; accounts.instruction(args) } @@ -202,15 +209,20 @@ impl<'a> SetCollectionSizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = SetCollectionSizeInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(4 + 1); account_infos.push(self.__program.clone()); @@ -293,12 +305,13 @@ impl<'a> SetCollectionSizeCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> SetCollectionSizeCpi<'a> { - let args = SetCollectionSizeInstructionArgs::new( - self.instruction + let args = SetCollectionSizeInstructionArgs { + set_collection_size_args: self + .instruction .set_collection_size_args .clone() .expect("set_collection_size_args is not set"), - ); + }; SetCollectionSizeCpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/set_token_standard.rs b/clients/rust/src/generated/instructions/set_token_standard.rs index 120cefa7..2085eab5 100644 --- a/clients/rust/src/generated/instructions/set_token_standard.rs +++ b/clients/rust/src/generated/instructions/set_token_standard.rs @@ -23,8 +23,6 @@ pub struct SetTokenStandard { impl SetTokenStandard { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = SetTokenStandardInstructionArgs::new(); - let mut accounts = Vec::with_capacity(4); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -43,26 +41,27 @@ impl SetTokenStandard { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = SetTokenStandardInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct SetTokenStandardInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct SetTokenStandardInstructionData { discriminator: u8, } -impl SetTokenStandardInstructionArgs { - pub fn new() -> Self { +impl SetTokenStandardInstructionData { + fn new() -> Self { Self { discriminator: 35 } } } @@ -145,8 +144,6 @@ impl<'a> SetTokenStandardCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = SetTokenStandardInstructionArgs::new(); - let mut accounts = Vec::with_capacity(4); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -167,15 +164,16 @@ impl<'a> SetTokenStandardCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = SetTokenStandardInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(4 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/sign_metadata.rs b/clients/rust/src/generated/instructions/sign_metadata.rs index 29a43a60..05d00f69 100644 --- a/clients/rust/src/generated/instructions/sign_metadata.rs +++ b/clients/rust/src/generated/instructions/sign_metadata.rs @@ -19,8 +19,6 @@ pub struct SignMetadata { impl SignMetadata { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = SignMetadataInstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -30,22 +28,23 @@ impl SignMetadata { self.creator, true, )); + let data = SignMetadataInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct SignMetadataInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct SignMetadataInstructionData { discriminator: u8, } -impl SignMetadataInstructionArgs { - pub fn new() -> Self { +impl SignMetadataInstructionData { + fn new() -> Self { Self { discriminator: 7 } } } @@ -104,8 +103,6 @@ impl<'a> SignMetadataCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = SignMetadataInstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -115,11 +112,12 @@ impl<'a> SignMetadataCpi<'a> { *self.creator.key, true, )); + let data = SignMetadataInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(2 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/thaw_delegated_account.rs b/clients/rust/src/generated/instructions/thaw_delegated_account.rs index 5e0f04e7..e322f6a8 100644 --- a/clients/rust/src/generated/instructions/thaw_delegated_account.rs +++ b/clients/rust/src/generated/instructions/thaw_delegated_account.rs @@ -25,8 +25,6 @@ pub struct ThawDelegatedAccount { impl ThawDelegatedAccount { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = ThawDelegatedAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(5); accounts.push(solana_program::instruction::AccountMeta::new( self.delegate, @@ -47,22 +45,25 @@ impl ThawDelegatedAccount { self.token_program, false, )); + let data = ThawDelegatedAccountInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct ThawDelegatedAccountInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct ThawDelegatedAccountInstructionData { discriminator: u8, } -impl ThawDelegatedAccountInstructionArgs { - pub fn new() -> Self { +impl ThawDelegatedAccountInstructionData { + fn new() -> Self { Self { discriminator: 27 } } } @@ -153,8 +154,6 @@ impl<'a> ThawDelegatedAccountCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = ThawDelegatedAccountInstructionArgs::new(); - let mut accounts = Vec::with_capacity(5); accounts.push(solana_program::instruction::AccountMeta::new( *self.delegate.key, @@ -176,11 +175,14 @@ impl<'a> ThawDelegatedAccountCpi<'a> { *self.token_program.key, false, )); + let data = ThawDelegatedAccountInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(5 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs index 39cc43a9..ebfcc52e 100644 --- a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs +++ b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs @@ -40,9 +40,10 @@ pub struct TransferOutOfEscrow { impl TransferOutOfEscrow { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = TransferOutOfEscrowInstructionArgs::new(); - + pub fn instruction( + &self, + args: TransferOutOfEscrowInstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(13); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.escrow, @@ -97,34 +98,40 @@ impl TransferOutOfEscrow { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = TransferOutOfEscrowInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct TransferOutOfEscrowInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct TransferOutOfEscrowInstructionData { discriminator: u8, - pub amount: u64, } -impl TransferOutOfEscrowInstructionArgs { - pub fn new() -> Self { - Self { - discriminator: 40, - amount: 1, - } +impl TransferOutOfEscrowInstructionData { + fn new() -> Self { + Self { discriminator: 40 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct TransferOutOfEscrowInstructionArgs { + pub amount: u64, +} + /// Instruction builder. #[derive(Default)] pub struct TransferOutOfEscrowBuilder { @@ -230,6 +237,7 @@ impl TransferOutOfEscrowBuilder { self.authority = Some(authority); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -260,8 +268,11 @@ impl TransferOutOfEscrowBuilder { )), authority: self.authority, }; + let args = TransferOutOfEscrowInstructionArgs { + amount: self.amount.clone().unwrap_or(1), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -295,6 +306,8 @@ pub struct TransferOutOfEscrowCpi<'a> { pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, /// Authority/creator of the escrow account pub authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: TransferOutOfEscrowInstructionArgs, } impl<'a> TransferOutOfEscrowCpi<'a> { @@ -307,8 +320,6 @@ impl<'a> TransferOutOfEscrowCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = TransferOutOfEscrowInstructionArgs::new(); - let mut accounts = Vec::with_capacity(13); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.escrow.key, @@ -365,15 +376,20 @@ impl<'a> TransferOutOfEscrowCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = TransferOutOfEscrowInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(13 + 1); account_infos.push(self.__program.clone()); @@ -542,6 +558,7 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { self.instruction.authority = Some(authority); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -549,6 +566,10 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> TransferOutOfEscrowCpi<'a> { + let args = TransferOutOfEscrowInstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + }; + TransferOutOfEscrowCpi { __program: self.instruction.__program, @@ -604,6 +625,7 @@ impl<'a> TransferOutOfEscrowCpiBuilder<'a> { .expect("sysvar_instructions is not set"), authority: self.instruction.authority, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/transfer_v1.rs b/clients/rust/src/generated/instructions/transfer_v1.rs index c5998fec..2256c740 100644 --- a/clients/rust/src/generated/instructions/transfer_v1.rs +++ b/clients/rust/src/generated/instructions/transfer_v1.rs @@ -49,9 +49,10 @@ pub struct TransferV1 { impl TransferV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = TransferV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: TransferV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(17); accounts.push(solana_program::instruction::AccountMeta::new( self.token, false, @@ -81,7 +82,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -92,7 +93,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -103,7 +104,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -137,7 +138,7 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -148,38 +149,43 @@ impl TransferV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = TransferV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct TransferV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct TransferV1InstructionData { discriminator: u8, transfer_v1_discriminator: u8, - pub amount: u64, - pub authorization_data: Option, } -impl TransferV1InstructionArgs { - pub fn new() -> Self { +impl TransferV1InstructionData { + fn new() -> Self { Self { discriminator: 49, transfer_v1_discriminator: 0, - amount: 1, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct TransferV1InstructionArgs { + pub amount: u64, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct TransferV1Builder { @@ -339,6 +345,7 @@ impl TransferV1Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.amount = Some(amount); @@ -383,8 +390,12 @@ impl TransferV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = TransferV1InstructionArgs { + amount: self.amount.clone().unwrap_or(1), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -426,6 +437,8 @@ pub struct TransferV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: TransferV1InstructionArgs, } impl<'a> TransferV1Cpi<'a> { @@ -438,8 +451,6 @@ impl<'a> TransferV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = TransferV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(17); accounts.push(solana_program::instruction::AccountMeta::new( *self.token.key, @@ -472,7 +483,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -483,7 +494,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -494,7 +505,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -529,7 +540,7 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -540,15 +551,18 @@ impl<'a> TransferV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = TransferV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(17 + 1); account_infos.push(self.__program.clone()); @@ -768,6 +782,7 @@ impl<'a> TransferV1CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to '1']` #[inline(always)] pub fn amount(&mut self, amount: u64) -> &mut Self { self.instruction.amount = Some(amount); @@ -781,6 +796,11 @@ impl<'a> TransferV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> TransferV1Cpi<'a> { + let args = TransferV1InstructionArgs { + amount: self.instruction.amount.clone().unwrap_or(1), + authorization_data: self.instruction.authorization_data.clone(), + }; + TransferV1Cpi { __program: self.instruction.__program, @@ -838,6 +858,7 @@ impl<'a> TransferV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/unlock_v1.rs b/clients/rust/src/generated/instructions/unlock_v1.rs index cb80c9a5..c48e2440 100644 --- a/clients/rust/src/generated/instructions/unlock_v1.rs +++ b/clients/rust/src/generated/instructions/unlock_v1.rs @@ -41,9 +41,10 @@ pub struct UnlockV1 { impl UnlockV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UnlockV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: UnlockV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(13); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -56,7 +57,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -76,7 +77,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -87,7 +88,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -109,7 +110,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -120,7 +121,7 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -131,36 +132,42 @@ impl UnlockV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UnlockV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UnlockV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UnlockV1InstructionData { discriminator: u8, unlock_v1_discriminator: u8, - pub authorization_data: Option, } -impl UnlockV1InstructionArgs { - pub fn new() -> Self { +impl UnlockV1InstructionData { + fn new() -> Self { Self { discriminator: 47, unlock_v1_discriminator: 0, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UnlockV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UnlockV1Builder { @@ -307,8 +314,11 @@ impl UnlockV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UnlockV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -342,6 +352,8 @@ pub struct UnlockV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UnlockV1InstructionArgs, } impl<'a> UnlockV1Cpi<'a> { @@ -354,8 +366,6 @@ impl<'a> UnlockV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UnlockV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(13); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -368,7 +378,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -391,7 +401,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -402,7 +412,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -425,7 +435,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -436,7 +446,7 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -447,15 +457,18 @@ impl<'a> UnlockV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UnlockV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(13 + 1); account_infos.push(self.__program.clone()); @@ -641,6 +654,10 @@ impl<'a> UnlockV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UnlockV1Cpi<'a> { + let args = UnlockV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + UnlockV1Cpi { __program: self.instruction.__program, @@ -675,6 +692,7 @@ impl<'a> UnlockV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/unverify_collection.rs b/clients/rust/src/generated/instructions/unverify_collection.rs index 97a3e0e3..ef1bd219 100644 --- a/clients/rust/src/generated/instructions/unverify_collection.rs +++ b/clients/rust/src/generated/instructions/unverify_collection.rs @@ -27,8 +27,6 @@ pub struct UnverifyCollection { impl UnverifyCollection { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UnverifyCollectionInstructionArgs::new(); - let mut accounts = Vec::with_capacity(6); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -57,26 +55,29 @@ impl UnverifyCollection { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = UnverifyCollectionInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UnverifyCollectionInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UnverifyCollectionInstructionData { discriminator: u8, } -impl UnverifyCollectionInstructionArgs { - pub fn new() -> Self { +impl UnverifyCollectionInstructionData { + fn new() -> Self { Self { discriminator: 22 } } } @@ -192,8 +193,6 @@ impl<'a> UnverifyCollectionCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UnverifyCollectionInstructionArgs::new(); - let mut accounts = Vec::with_capacity(6); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -222,15 +221,18 @@ impl<'a> UnverifyCollectionCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = UnverifyCollectionInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(6 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/unverify_collection_v1.rs b/clients/rust/src/generated/instructions/unverify_collection_v1.rs index ab8c0265..6711c6ef 100644 --- a/clients/rust/src/generated/instructions/unverify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_collection_v1.rs @@ -29,8 +29,6 @@ pub struct UnverifyCollectionV1 { impl UnverifyCollectionV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UnverifyCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -43,7 +41,7 @@ impl UnverifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -62,7 +60,7 @@ impl UnverifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -74,23 +72,26 @@ impl UnverifyCollectionV1 { self.sysvar_instructions, false, )); + let data = UnverifyCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UnverifyCollectionV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UnverifyCollectionV1InstructionData { discriminator: u8, unverify_collection_v1_discriminator: u8, } -impl UnverifyCollectionV1InstructionArgs { - pub fn new() -> Self { +impl UnverifyCollectionV1InstructionData { + fn new() -> Self { Self { discriminator: 53, unverify_collection_v1_discriminator: 1, @@ -220,8 +221,6 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UnverifyCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -234,7 +233,7 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -253,7 +252,7 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -265,11 +264,14 @@ impl<'a> UnverifyCollectionV1Cpi<'a> { *self.sysvar_instructions.key, false, )); + let data = UnverifyCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/unverify_creator_v1.rs b/clients/rust/src/generated/instructions/unverify_creator_v1.rs index c835637e..89469179 100644 --- a/clients/rust/src/generated/instructions/unverify_creator_v1.rs +++ b/clients/rust/src/generated/instructions/unverify_creator_v1.rs @@ -29,8 +29,6 @@ pub struct UnverifyCreatorV1 { impl UnverifyCreatorV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UnverifyCreatorV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -43,7 +41,7 @@ impl UnverifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -58,7 +56,7 @@ impl UnverifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -69,7 +67,7 @@ impl UnverifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -81,23 +79,26 @@ impl UnverifyCreatorV1 { self.sysvar_instructions, false, )); + let data = UnverifyCreatorV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UnverifyCreatorV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UnverifyCreatorV1InstructionData { discriminator: u8, unverify_creator_v1_discriminator: u8, } -impl UnverifyCreatorV1InstructionArgs { - pub fn new() -> Self { +impl UnverifyCreatorV1InstructionData { + fn new() -> Self { Self { discriminator: 53, unverify_creator_v1_discriminator: 0, @@ -228,8 +229,6 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UnverifyCreatorV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -242,7 +241,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -257,7 +256,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -268,7 +267,7 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -280,11 +279,14 @@ impl<'a> UnverifyCreatorV1Cpi<'a> { *self.sysvar_instructions.key, false, )); + let data = UnverifyCreatorV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs index 7cf055ad..7d714976 100644 --- a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs @@ -29,8 +29,6 @@ pub struct UnverifySizedCollectionItem { impl UnverifySizedCollectionItem { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UnverifySizedCollectionItemInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -62,26 +60,29 @@ impl UnverifySizedCollectionItem { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = UnverifySizedCollectionItemInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UnverifySizedCollectionItemInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UnverifySizedCollectionItemInstructionData { discriminator: u8, } -impl UnverifySizedCollectionItemInstructionArgs { - pub fn new() -> Self { +impl UnverifySizedCollectionItemInstructionData { + fn new() -> Self { Self { discriminator: 31 } } } @@ -207,8 +208,6 @@ impl<'a> UnverifySizedCollectionItemCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UnverifySizedCollectionItemInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -241,15 +240,18 @@ impl<'a> UnverifySizedCollectionItemCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = UnverifySizedCollectionItemInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs index 8211ab10..2858d93b 100644 --- a/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_authority_item_delegate_v2.rs @@ -39,9 +39,10 @@ pub struct UpdateAsAuthorityItemDelegateV2 { impl UpdateAsAuthorityItemDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsAuthorityItemDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsAuthorityItemDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -54,7 +55,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -64,7 +65,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -81,7 +82,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -103,7 +104,7 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -114,44 +115,48 @@ impl UpdateAsAuthorityItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsAuthorityItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsAuthorityItemDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsAuthorityItemDelegateV2InstructionData { discriminator: u8, update_as_authority_item_delegate_v2_discriminator: u8, - pub new_update_authority: Option, - pub primary_sale_happened: Option, - pub is_mutable: Option, - pub token_standard: Option, - pub authorization_data: Option, } -impl UpdateAsAuthorityItemDelegateV2InstructionArgs { - pub fn new() -> Self { +impl UpdateAsAuthorityItemDelegateV2InstructionData { + fn new() -> Self { Self { discriminator: 50, update_as_authority_item_delegate_v2_discriminator: 2, - new_update_authority: None, - primary_sale_happened: None, - is_mutable: None, - token_standard: None, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsAuthorityItemDelegateV2InstructionArgs { + pub new_update_authority: Option, + pub primary_sale_happened: Option, + pub is_mutable: Option, + pub token_standard: Option, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UpdateAsAuthorityItemDelegateV2Builder { @@ -309,8 +314,15 @@ impl UpdateAsAuthorityItemDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsAuthorityItemDelegateV2InstructionArgs { + new_update_authority: self.new_update_authority.clone(), + primary_sale_happened: self.primary_sale_happened.clone(), + is_mutable: self.is_mutable.clone(), + token_standard: self.token_standard.clone(), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -340,6 +352,8 @@ pub struct UpdateAsAuthorityItemDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsAuthorityItemDelegateV2InstructionArgs, } impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { @@ -352,8 +366,6 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsAuthorityItemDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -366,7 +378,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -376,7 +388,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -395,7 +407,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -418,7 +430,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -429,15 +441,20 @@ impl<'a> UpdateAsAuthorityItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsAuthorityItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -626,6 +643,14 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsAuthorityItemDelegateV2Cpi<'a> { + let args = UpdateAsAuthorityItemDelegateV2InstructionArgs { + new_update_authority: self.instruction.new_update_authority.clone(), + primary_sale_happened: self.instruction.primary_sale_happened.clone(), + is_mutable: self.instruction.is_mutable.clone(), + token_standard: self.instruction.token_standard.clone(), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsAuthorityItemDelegateV2Cpi { __program: self.instruction.__program, @@ -656,6 +681,7 @@ impl<'a> UpdateAsAuthorityItemDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs index 3a0e118b..fbc84643 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_delegate_v2.rs @@ -38,9 +38,10 @@ pub struct UpdateAsCollectionDelegateV2 { impl UpdateAsCollectionDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsCollectionDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsCollectionDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -53,7 +54,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -63,7 +64,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -80,7 +81,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -102,7 +103,7 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -113,38 +114,45 @@ impl UpdateAsCollectionDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsCollectionDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsCollectionDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsCollectionDelegateV2InstructionData { discriminator: u8, update_as_collection_delegate_v2_discriminator: u8, - pub collection: CollectionToggle, - pub authorization_data: Option, } -impl UpdateAsCollectionDelegateV2InstructionArgs { - pub fn new() -> Self { +impl UpdateAsCollectionDelegateV2InstructionData { + fn new() -> Self { Self { discriminator: 50, update_as_collection_delegate_v2_discriminator: 3, - collection: CollectionToggle::None, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsCollectionDelegateV2InstructionArgs { + pub collection: CollectionToggle, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UpdateAsCollectionDelegateV2Builder { @@ -250,6 +258,7 @@ impl UpdateAsCollectionDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); @@ -280,8 +289,12 @@ impl UpdateAsCollectionDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsCollectionDelegateV2InstructionArgs { + collection: self.collection.clone().unwrap_or(CollectionToggle::None), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -311,6 +324,8 @@ pub struct UpdateAsCollectionDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsCollectionDelegateV2InstructionArgs, } impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { @@ -323,8 +338,6 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsCollectionDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -337,7 +350,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -347,7 +360,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -366,7 +379,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -389,7 +402,7 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -400,15 +413,20 @@ impl<'a> UpdateAsCollectionDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsCollectionDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -562,6 +580,7 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); @@ -575,6 +594,15 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsCollectionDelegateV2Cpi<'a> { + let args = UpdateAsCollectionDelegateV2InstructionArgs { + collection: self + .instruction + .collection + .clone() + .unwrap_or(CollectionToggle::None), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsCollectionDelegateV2Cpi { __program: self.instruction.__program, @@ -605,6 +633,7 @@ impl<'a> UpdateAsCollectionDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs index dc77749c..0015f284 100644 --- a/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_collection_item_delegate_v2.rs @@ -38,9 +38,10 @@ pub struct UpdateAsCollectionItemDelegateV2 { impl UpdateAsCollectionItemDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsCollectionItemDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsCollectionItemDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -53,7 +54,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -63,7 +64,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -80,7 +81,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -102,7 +103,7 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -113,38 +114,45 @@ impl UpdateAsCollectionItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsCollectionItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsCollectionItemDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsCollectionItemDelegateV2InstructionData { discriminator: u8, update_as_collection_item_delegate_v2_discriminator: u8, - pub collection: CollectionToggle, - pub authorization_data: Option, } -impl UpdateAsCollectionItemDelegateV2InstructionArgs { - pub fn new() -> Self { +impl UpdateAsCollectionItemDelegateV2InstructionData { + fn new() -> Self { Self { discriminator: 50, update_as_collection_item_delegate_v2_discriminator: 7, - collection: CollectionToggle::None, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsCollectionItemDelegateV2InstructionArgs { + pub collection: CollectionToggle, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UpdateAsCollectionItemDelegateV2Builder { @@ -250,6 +258,7 @@ impl UpdateAsCollectionItemDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); @@ -280,8 +289,12 @@ impl UpdateAsCollectionItemDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsCollectionItemDelegateV2InstructionArgs { + collection: self.collection.clone().unwrap_or(CollectionToggle::None), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -311,6 +324,8 @@ pub struct UpdateAsCollectionItemDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsCollectionItemDelegateV2InstructionArgs, } impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { @@ -323,8 +338,6 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsCollectionItemDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -337,7 +350,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -347,7 +360,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -366,7 +379,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -389,7 +402,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -400,15 +413,20 @@ impl<'a> UpdateAsCollectionItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsCollectionItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -562,6 +580,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); @@ -575,6 +594,15 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsCollectionItemDelegateV2Cpi<'a> { + let args = UpdateAsCollectionItemDelegateV2InstructionArgs { + collection: self + .instruction + .collection + .clone() + .unwrap_or(CollectionToggle::None), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsCollectionItemDelegateV2Cpi { __program: self.instruction.__program, @@ -605,6 +633,7 @@ impl<'a> UpdateAsCollectionItemDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs index 544a5c91..2eb79827 100644 --- a/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_delegate_v2.rs @@ -38,9 +38,10 @@ pub struct UpdateAsDataDelegateV2 { impl UpdateAsDataDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsDataDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsDataDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -53,7 +54,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -63,7 +64,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -80,7 +81,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -102,7 +103,7 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -113,23 +114,41 @@ impl UpdateAsDataDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsDataDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsDataDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsDataDelegateV2InstructionData { discriminator: u8, update_as_data_delegate_v2_discriminator: u8, +} + +impl UpdateAsDataDelegateV2InstructionData { + fn new() -> Self { + Self { + discriminator: 50, + update_as_data_delegate_v2_discriminator: 4, + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsDataDelegateV2InstructionArgs { pub data: Option, pub authorization_data: Option, } @@ -143,17 +162,6 @@ pub struct UpdateAsDataDelegateV2InstructionDataData { pub creators: Option>, } -impl UpdateAsDataDelegateV2InstructionArgs { - pub fn new() -> Self { - Self { - discriminator: 50, - update_as_data_delegate_v2_discriminator: 4, - data: None, - authorization_data: None, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct UpdateAsDataDelegateV2Builder { @@ -290,8 +298,12 @@ impl UpdateAsDataDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsDataDelegateV2InstructionArgs { + data: self.data.clone(), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -321,6 +333,8 @@ pub struct UpdateAsDataDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsDataDelegateV2InstructionArgs, } impl<'a> UpdateAsDataDelegateV2Cpi<'a> { @@ -333,8 +347,6 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsDataDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -347,7 +359,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -357,7 +369,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -376,7 +388,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +411,7 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,15 +422,20 @@ impl<'a> UpdateAsDataDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsDataDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -586,6 +603,11 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsDataDelegateV2Cpi<'a> { + let args = UpdateAsDataDelegateV2InstructionArgs { + data: self.instruction.data.clone(), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsDataDelegateV2Cpi { __program: self.instruction.__program, @@ -616,6 +638,7 @@ impl<'a> UpdateAsDataDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs index 5a176829..4d7031ba 100644 --- a/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_data_item_delegate_v2.rs @@ -38,9 +38,10 @@ pub struct UpdateAsDataItemDelegateV2 { impl UpdateAsDataItemDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsDataItemDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsDataItemDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -53,7 +54,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -63,7 +64,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -80,7 +81,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -102,7 +103,7 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -113,23 +114,41 @@ impl UpdateAsDataItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsDataItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsDataItemDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsDataItemDelegateV2InstructionData { discriminator: u8, update_as_data_item_delegate_v2_discriminator: u8, +} + +impl UpdateAsDataItemDelegateV2InstructionData { + fn new() -> Self { + Self { + discriminator: 50, + update_as_data_item_delegate_v2_discriminator: 6, + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsDataItemDelegateV2InstructionArgs { pub data: Option, pub authorization_data: Option, } @@ -143,17 +162,6 @@ pub struct UpdateAsDataItemDelegateV2InstructionDataData { pub creators: Option>, } -impl UpdateAsDataItemDelegateV2InstructionArgs { - pub fn new() -> Self { - Self { - discriminator: 50, - update_as_data_item_delegate_v2_discriminator: 6, - data: None, - authorization_data: None, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct UpdateAsDataItemDelegateV2Builder { @@ -290,8 +298,12 @@ impl UpdateAsDataItemDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsDataItemDelegateV2InstructionArgs { + data: self.data.clone(), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -321,6 +333,8 @@ pub struct UpdateAsDataItemDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsDataItemDelegateV2InstructionArgs, } impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { @@ -333,8 +347,6 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsDataItemDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -347,7 +359,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -357,7 +369,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -376,7 +388,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -399,7 +411,7 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -410,15 +422,20 @@ impl<'a> UpdateAsDataItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsDataItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -586,6 +603,11 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsDataItemDelegateV2Cpi<'a> { + let args = UpdateAsDataItemDelegateV2InstructionArgs { + data: self.instruction.data.clone(), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsDataItemDelegateV2Cpi { __program: self.instruction.__program, @@ -616,6 +638,7 @@ impl<'a> UpdateAsDataItemDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs index e4583e71..96cdb19c 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_delegate_v2.rs @@ -38,9 +38,10 @@ pub struct UpdateAsProgrammableConfigDelegateV2 { impl UpdateAsProgrammableConfigDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsProgrammableConfigDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsProgrammableConfigDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -53,7 +54,7 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -106,38 +107,45 @@ impl UpdateAsProgrammableConfigDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsProgrammableConfigDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsProgrammableConfigDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsProgrammableConfigDelegateV2InstructionData { discriminator: u8, update_as_programmable_config_delegate_v2_discriminator: u8, - pub rule_set: RuleSetToggle, - pub authorization_data: Option, } -impl UpdateAsProgrammableConfigDelegateV2InstructionArgs { - pub fn new() -> Self { +impl UpdateAsProgrammableConfigDelegateV2InstructionData { + fn new() -> Self { Self { discriminator: 50, update_as_programmable_config_delegate_v2_discriminator: 5, - rule_set: RuleSetToggle::None, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsProgrammableConfigDelegateV2InstructionArgs { + pub rule_set: RuleSetToggle, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UpdateAsProgrammableConfigDelegateV2Builder { @@ -242,6 +250,7 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); @@ -272,8 +281,12 @@ impl UpdateAsProgrammableConfigDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsProgrammableConfigDelegateV2InstructionArgs { + rule_set: self.rule_set.clone().unwrap_or(RuleSetToggle::None), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -303,6 +316,8 @@ pub struct UpdateAsProgrammableConfigDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsProgrammableConfigDelegateV2InstructionArgs, } impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { @@ -315,8 +330,6 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsProgrammableConfigDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -329,7 +342,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -352,7 +365,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -375,7 +388,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -386,15 +399,20 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsProgrammableConfigDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -545,6 +563,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); @@ -558,6 +577,15 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsProgrammableConfigDelegateV2Cpi<'a> { + let args = UpdateAsProgrammableConfigDelegateV2InstructionArgs { + rule_set: self + .instruction + .rule_set + .clone() + .unwrap_or(RuleSetToggle::None), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsProgrammableConfigDelegateV2Cpi { __program: self.instruction.__program, @@ -588,6 +616,7 @@ impl<'a> UpdateAsProgrammableConfigDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs index dd508e5e..0c5c2c03 100644 --- a/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_programmable_config_item_delegate_v2.rs @@ -38,9 +38,10 @@ pub struct UpdateAsProgrammableConfigItemDelegateV2 { impl UpdateAsProgrammableConfigItemDelegateV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsProgrammableConfigItemDelegateV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsProgrammableConfigItemDelegateV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -53,7 +54,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -73,7 +74,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -95,7 +96,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -106,38 +107,45 @@ impl UpdateAsProgrammableConfigItemDelegateV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsProgrammableConfigItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsProgrammableConfigItemDelegateV2InstructionData { discriminator: u8, update_as_programmable_config_item_delegate_v2_discriminator: u8, - pub rule_set: RuleSetToggle, - pub authorization_data: Option, } -impl UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { - pub fn new() -> Self { +impl UpdateAsProgrammableConfigItemDelegateV2InstructionData { + fn new() -> Self { Self { discriminator: 50, update_as_programmable_config_item_delegate_v2_discriminator: 8, - rule_set: RuleSetToggle::None, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { + pub rule_set: RuleSetToggle, + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UpdateAsProgrammableConfigItemDelegateV2Builder { @@ -242,6 +250,7 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { self.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); @@ -272,8 +281,12 @@ impl UpdateAsProgrammableConfigItemDelegateV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { + rule_set: self.rule_set.clone().unwrap_or(RuleSetToggle::None), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -303,6 +316,8 @@ pub struct UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsProgrammableConfigItemDelegateV2InstructionArgs, } impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { @@ -315,8 +330,6 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsProgrammableConfigItemDelegateV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -329,7 +342,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -352,7 +365,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -375,7 +388,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -386,15 +399,20 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsProgrammableConfigItemDelegateV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -547,6 +565,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { self.instruction.authorization_rules = Some(authorization_rules); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); @@ -560,6 +579,15 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsProgrammableConfigItemDelegateV2Cpi<'a> { + let args = UpdateAsProgrammableConfigItemDelegateV2InstructionArgs { + rule_set: self + .instruction + .rule_set + .clone() + .unwrap_or(RuleSetToggle::None), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsProgrammableConfigItemDelegateV2Cpi { __program: self.instruction.__program, @@ -590,6 +618,7 @@ impl<'a> UpdateAsProgrammableConfigItemDelegateV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs index d005507e..3c025ae9 100644 --- a/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs +++ b/clients/rust/src/generated/instructions/update_as_update_authority_v2.rs @@ -44,9 +44,10 @@ pub struct UpdateAsUpdateAuthorityV2 { impl UpdateAsUpdateAuthorityV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateAsUpdateAuthorityV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateAsUpdateAuthorityV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -59,7 +60,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -69,7 +70,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -86,7 +87,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -108,7 +109,7 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -119,23 +120,41 @@ impl UpdateAsUpdateAuthorityV2 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsUpdateAuthorityV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateAsUpdateAuthorityV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateAsUpdateAuthorityV2InstructionData { discriminator: u8, update_as_update_authority_v2_discriminator: u8, +} + +impl UpdateAsUpdateAuthorityV2InstructionData { + fn new() -> Self { + Self { + discriminator: 50, + update_as_update_authority_v2_discriminator: 1, + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateAsUpdateAuthorityV2InstructionArgs { pub new_update_authority: Option, pub data: Option, pub primary_sale_happened: Option, @@ -157,25 +176,6 @@ pub struct UpdateAsUpdateAuthorityV2InstructionDataData { pub creators: Option>, } -impl UpdateAsUpdateAuthorityV2InstructionArgs { - pub fn new() -> Self { - Self { - discriminator: 50, - update_as_update_authority_v2_discriminator: 1, - new_update_authority: None, - data: None, - primary_sale_happened: None, - is_mutable: None, - collection: CollectionToggle::None, - collection_details: CollectionDetailsToggle::None, - uses: UsesToggle::None, - rule_set: RuleSetToggle::None, - token_standard: None, - authorization_data: None, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct UpdateAsUpdateAuthorityV2Builder { @@ -313,21 +313,25 @@ impl UpdateAsUpdateAuthorityV2Builder { self.is_mutable = Some(is_mutable); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); self } + /// `[optional argument, defaults to 'CollectionDetailsToggle::None']` #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.collection_details = Some(collection_details); self } + /// `[optional argument, defaults to 'UsesToggle::None']` #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.uses = Some(uses); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); @@ -364,8 +368,23 @@ impl UpdateAsUpdateAuthorityV2Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateAsUpdateAuthorityV2InstructionArgs { + new_update_authority: self.new_update_authority.clone(), + data: self.data.clone(), + primary_sale_happened: self.primary_sale_happened.clone(), + is_mutable: self.is_mutable.clone(), + collection: self.collection.clone().unwrap_or(CollectionToggle::None), + collection_details: self + .collection_details + .clone() + .unwrap_or(CollectionDetailsToggle::None), + uses: self.uses.clone().unwrap_or(UsesToggle::None), + rule_set: self.rule_set.clone().unwrap_or(RuleSetToggle::None), + token_standard: self.token_standard.clone(), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -395,6 +414,8 @@ pub struct UpdateAsUpdateAuthorityV2Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateAsUpdateAuthorityV2InstructionArgs, } impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { @@ -407,8 +428,6 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateAsUpdateAuthorityV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -421,7 +440,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -431,7 +450,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -450,7 +469,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -473,7 +492,7 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -484,15 +503,20 @@ impl<'a> UpdateAsUpdateAuthorityV2Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateAsUpdateAuthorityV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -678,21 +702,25 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { self.instruction.is_mutable = Some(is_mutable); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); self } + /// `[optional argument, defaults to 'CollectionDetailsToggle::None']` #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.instruction.collection_details = Some(collection_details); self } + /// `[optional argument, defaults to 'UsesToggle::None']` #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.instruction.uses = Some(uses); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); @@ -712,6 +740,31 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateAsUpdateAuthorityV2Cpi<'a> { + let args = UpdateAsUpdateAuthorityV2InstructionArgs { + new_update_authority: self.instruction.new_update_authority.clone(), + data: self.instruction.data.clone(), + primary_sale_happened: self.instruction.primary_sale_happened.clone(), + is_mutable: self.instruction.is_mutable.clone(), + collection: self + .instruction + .collection + .clone() + .unwrap_or(CollectionToggle::None), + collection_details: self + .instruction + .collection_details + .clone() + .unwrap_or(CollectionDetailsToggle::None), + uses: self.instruction.uses.clone().unwrap_or(UsesToggle::None), + rule_set: self + .instruction + .rule_set + .clone() + .unwrap_or(RuleSetToggle::None), + token_standard: self.instruction.token_standard.clone(), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateAsUpdateAuthorityV2Cpi { __program: self.instruction.__program, @@ -742,6 +795,7 @@ impl<'a> UpdateAsUpdateAuthorityV2CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs index ee3a9746..6fb291ea 100644 --- a/clients/rust/src/generated/instructions/update_metadata_account_v2.rs +++ b/clients/rust/src/generated/instructions/update_metadata_account_v2.rs @@ -20,9 +20,10 @@ pub struct UpdateMetadataAccountV2 { impl UpdateMetadataAccountV2 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateMetadataAccountV2InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateMetadataAccountV2InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -32,36 +33,39 @@ impl UpdateMetadataAccountV2 { self.update_authority, true, )); + let mut data = UpdateMetadataAccountV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateMetadataAccountV2InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateMetadataAccountV2InstructionData { discriminator: u8, +} + +impl UpdateMetadataAccountV2InstructionData { + fn new() -> Self { + Self { discriminator: 15 } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateMetadataAccountV2InstructionArgs { pub data: Option, pub new_update_authority: Option, pub primary_sale_happened: Option, pub is_mutable: Option, } -impl UpdateMetadataAccountV2InstructionArgs { - pub fn new() -> Self { - Self { - discriminator: 15, - data: None, - new_update_authority: None, - primary_sale_happened: None, - is_mutable: None, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct UpdateMetadataAccountV2Builder { @@ -122,8 +126,14 @@ impl UpdateMetadataAccountV2Builder { metadata: self.metadata.expect("metadata is not set"), update_authority: self.update_authority.expect("update_authority is not set"), }; + let args = UpdateMetadataAccountV2InstructionArgs { + data: self.data.clone(), + new_update_authority: self.new_update_authority.clone(), + primary_sale_happened: self.primary_sale_happened.clone(), + is_mutable: self.is_mutable.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -135,6 +145,8 @@ pub struct UpdateMetadataAccountV2Cpi<'a> { pub metadata: &'a solana_program::account_info::AccountInfo<'a>, /// Update authority key pub update_authority: &'a solana_program::account_info::AccountInfo<'a>, + /// The arguments for the instruction. + pub __args: UpdateMetadataAccountV2InstructionArgs, } impl<'a> UpdateMetadataAccountV2Cpi<'a> { @@ -147,8 +159,6 @@ impl<'a> UpdateMetadataAccountV2Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateMetadataAccountV2InstructionArgs::new(); - let mut accounts = Vec::with_capacity(2); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -158,11 +168,16 @@ impl<'a> UpdateMetadataAccountV2Cpi<'a> { *self.update_authority.key, true, )); + let mut data = UpdateMetadataAccountV2InstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(2 + 1); account_infos.push(self.__program.clone()); @@ -239,6 +254,13 @@ impl<'a> UpdateMetadataAccountV2CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateMetadataAccountV2Cpi<'a> { + let args = UpdateMetadataAccountV2InstructionArgs { + data: self.instruction.data.clone(), + new_update_authority: self.instruction.new_update_authority.clone(), + primary_sale_happened: self.instruction.primary_sale_happened.clone(), + is_mutable: self.instruction.is_mutable.clone(), + }; + UpdateMetadataAccountV2Cpi { __program: self.instruction.__program, @@ -248,6 +270,7 @@ impl<'a> UpdateMetadataAccountV2CpiBuilder<'a> { .instruction .update_authority .expect("update_authority is not set"), + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs index 278c769f..10554170 100644 --- a/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs +++ b/clients/rust/src/generated/instructions/update_primary_sale_happened_via_token.rs @@ -21,8 +21,6 @@ pub struct UpdatePrimarySaleHappenedViaToken { impl UpdatePrimarySaleHappenedViaToken { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdatePrimarySaleHappenedViaTokenInstructionArgs::new(); - let mut accounts = Vec::with_capacity(3); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -34,22 +32,25 @@ impl UpdatePrimarySaleHappenedViaToken { accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.token, false, )); + let data = UpdatePrimarySaleHappenedViaTokenInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdatePrimarySaleHappenedViaTokenInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdatePrimarySaleHappenedViaTokenInstructionData { discriminator: u8, } -impl UpdatePrimarySaleHappenedViaTokenInstructionArgs { - pub fn new() -> Self { +impl UpdatePrimarySaleHappenedViaTokenInstructionData { + fn new() -> Self { Self { discriminator: 4 } } } @@ -118,8 +119,6 @@ impl<'a> UpdatePrimarySaleHappenedViaTokenCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdatePrimarySaleHappenedViaTokenInstructionArgs::new(); - let mut accounts = Vec::with_capacity(3); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -133,11 +132,14 @@ impl<'a> UpdatePrimarySaleHappenedViaTokenCpi<'a> { *self.token.key, false, )); + let data = UpdatePrimarySaleHappenedViaTokenInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(3 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/update_v1.rs b/clients/rust/src/generated/instructions/update_v1.rs index fcf0c01d..49bad8ab 100644 --- a/clients/rust/src/generated/instructions/update_v1.rs +++ b/clients/rust/src/generated/instructions/update_v1.rs @@ -43,9 +43,10 @@ pub struct UpdateV1 { impl UpdateV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UpdateV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: UpdateV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -58,7 +59,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -68,7 +69,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -85,7 +86,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -107,7 +108,7 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -118,23 +119,39 @@ impl UpdateV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UpdateV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UpdateV1InstructionData { discriminator: u8, update_v1_discriminator: u8, +} + +impl UpdateV1InstructionData { + fn new() -> Self { + Self { + discriminator: 50, + update_v1_discriminator: 0, + } + } +} + +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UpdateV1InstructionArgs { pub new_update_authority: Option, pub data: Option, pub primary_sale_happened: Option, @@ -155,24 +172,6 @@ pub struct UpdateV1InstructionDataData { pub creators: Option>, } -impl UpdateV1InstructionArgs { - pub fn new() -> Self { - Self { - discriminator: 50, - update_v1_discriminator: 0, - new_update_authority: None, - data: None, - primary_sale_happened: None, - is_mutable: None, - collection: CollectionToggle::None, - collection_details: CollectionDetailsToggle::None, - uses: UsesToggle::None, - rule_set: RuleSetToggle::None, - authorization_data: None, - } - } -} - /// Instruction builder. #[derive(Default)] pub struct UpdateV1Builder { @@ -309,21 +308,25 @@ impl UpdateV1Builder { self.is_mutable = Some(is_mutable); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.collection = Some(collection); self } + /// `[optional argument, defaults to 'CollectionDetailsToggle::None']` #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.collection_details = Some(collection_details); self } + /// `[optional argument, defaults to 'UsesToggle::None']` #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.uses = Some(uses); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.rule_set = Some(rule_set); @@ -354,8 +357,22 @@ impl UpdateV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UpdateV1InstructionArgs { + new_update_authority: self.new_update_authority.clone(), + data: self.data.clone(), + primary_sale_happened: self.primary_sale_happened.clone(), + is_mutable: self.is_mutable.clone(), + collection: self.collection.clone().unwrap_or(CollectionToggle::None), + collection_details: self + .collection_details + .clone() + .unwrap_or(CollectionDetailsToggle::None), + uses: self.uses.clone().unwrap_or(UsesToggle::None), + rule_set: self.rule_set.clone().unwrap_or(RuleSetToggle::None), + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -385,6 +402,8 @@ pub struct UpdateV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UpdateV1InstructionArgs, } impl<'a> UpdateV1Cpi<'a> { @@ -397,8 +416,6 @@ impl<'a> UpdateV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UpdateV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(11); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -411,7 +428,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -421,7 +438,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -440,7 +457,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -463,7 +480,7 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -474,15 +491,18 @@ impl<'a> UpdateV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UpdateV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -667,21 +687,25 @@ impl<'a> UpdateV1CpiBuilder<'a> { self.instruction.is_mutable = Some(is_mutable); self } + /// `[optional argument, defaults to 'CollectionToggle::None']` #[inline(always)] pub fn collection(&mut self, collection: CollectionToggle) -> &mut Self { self.instruction.collection = Some(collection); self } + /// `[optional argument, defaults to 'CollectionDetailsToggle::None']` #[inline(always)] pub fn collection_details(&mut self, collection_details: CollectionDetailsToggle) -> &mut Self { self.instruction.collection_details = Some(collection_details); self } + /// `[optional argument, defaults to 'UsesToggle::None']` #[inline(always)] pub fn uses(&mut self, uses: UsesToggle) -> &mut Self { self.instruction.uses = Some(uses); self } + /// `[optional argument, defaults to 'RuleSetToggle::None']` #[inline(always)] pub fn rule_set(&mut self, rule_set: RuleSetToggle) -> &mut Self { self.instruction.rule_set = Some(rule_set); @@ -695,6 +719,30 @@ impl<'a> UpdateV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UpdateV1Cpi<'a> { + let args = UpdateV1InstructionArgs { + new_update_authority: self.instruction.new_update_authority.clone(), + data: self.instruction.data.clone(), + primary_sale_happened: self.instruction.primary_sale_happened.clone(), + is_mutable: self.instruction.is_mutable.clone(), + collection: self + .instruction + .collection + .clone() + .unwrap_or(CollectionToggle::None), + collection_details: self + .instruction + .collection_details + .clone() + .unwrap_or(CollectionDetailsToggle::None), + uses: self.instruction.uses.clone().unwrap_or(UsesToggle::None), + rule_set: self + .instruction + .rule_set + .clone() + .unwrap_or(RuleSetToggle::None), + authorization_data: self.instruction.authorization_data.clone(), + }; + UpdateV1Cpi { __program: self.instruction.__program, @@ -725,6 +773,7 @@ impl<'a> UpdateV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/use_v1.rs b/clients/rust/src/generated/instructions/use_v1.rs index 950291d7..709466ca 100644 --- a/clients/rust/src/generated/instructions/use_v1.rs +++ b/clients/rust/src/generated/instructions/use_v1.rs @@ -39,9 +39,10 @@ pub struct UseV1 { impl UseV1 { #[allow(clippy::vec_init_then_push)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = UseV1InstructionArgs::new(); - + pub fn instruction( + &self, + args: UseV1InstructionArgs, + ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(12); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -54,7 +55,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -62,7 +63,7 @@ impl UseV1 { accounts.push(solana_program::instruction::AccountMeta::new(token, false)); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -79,7 +80,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -101,7 +102,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -112,7 +113,7 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -123,36 +124,42 @@ impl UseV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UseV1InstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct UseV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UseV1InstructionData { discriminator: u8, use_v1_discriminator: u8, - pub authorization_data: Option, } -impl UseV1InstructionArgs { - pub fn new() -> Self { +impl UseV1InstructionData { + fn new() -> Self { Self { discriminator: 51, use_v1_discriminator: 0, - authorization_data: None, } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UseV1InstructionArgs { + pub authorization_data: Option, +} + /// Instruction builder. #[derive(Default)] pub struct UseV1Builder { @@ -294,8 +301,11 @@ impl UseV1Builder { authorization_rules_program: self.authorization_rules_program, authorization_rules: self.authorization_rules, }; + let args = UseV1InstructionArgs { + authorization_data: self.authorization_data.clone(), + }; - accounts.instruction() + accounts.instruction(args) } } @@ -327,6 +337,8 @@ pub struct UseV1Cpi<'a> { pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// Token Authorization Rules account pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: UseV1InstructionArgs, } impl<'a> UseV1Cpi<'a> { @@ -339,8 +351,6 @@ impl<'a> UseV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = UseV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(12); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -353,7 +363,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -363,7 +373,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -382,7 +392,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -405,7 +415,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -416,7 +426,7 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -427,15 +437,18 @@ impl<'a> UseV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UseV1InstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(12 + 1); account_infos.push(self.__program.clone()); @@ -610,6 +623,10 @@ impl<'a> UseV1CpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UseV1Cpi<'a> { + let args = UseV1InstructionArgs { + authorization_data: self.instruction.authorization_data.clone(), + }; + UseV1Cpi { __program: self.instruction.__program, @@ -642,6 +659,7 @@ impl<'a> UseV1CpiBuilder<'a> { authorization_rules_program: self.instruction.authorization_rules_program, authorization_rules: self.instruction.authorization_rules, + __args: args, } } } diff --git a/clients/rust/src/generated/instructions/utilize.rs b/clients/rust/src/generated/instructions/utilize.rs index 95cfbf06..48388170 100644 --- a/clients/rust/src/generated/instructions/utilize.rs +++ b/clients/rust/src/generated/instructions/utilize.rs @@ -81,7 +81,7 @@ impl Utilize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -91,34 +91,38 @@ impl Utilize { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UtilizeInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -pub struct UtilizeInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct UtilizeInstructionData { discriminator: u8, - pub number_of_uses: u64, } -impl UtilizeInstructionArgs { - pub fn new(number_of_uses: u64) -> Self { - Self { - discriminator: 19, - number_of_uses, - } +impl UtilizeInstructionData { + fn new() -> Self { + Self { discriminator: 19 } } } +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct UtilizeInstructionArgs { + pub number_of_uses: u64, +} + /// Instruction builder. #[derive(Default)] pub struct UtilizeBuilder { @@ -239,11 +243,12 @@ impl UtilizeBuilder { use_authority_record: self.use_authority_record, burner: self.burner, }; - let args = UtilizeInstructionArgs::new( - self.number_of_uses + let args = UtilizeInstructionArgs { + number_of_uses: self + .number_of_uses .clone() .expect("number_of_uses is not set"), - ); + }; accounts.instruction(args) } @@ -333,7 +338,7 @@ impl<'a> UtilizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -344,15 +349,18 @@ impl<'a> UtilizeCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let mut data = UtilizeInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: self.__args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(11 + 1); account_infos.push(self.__program.clone()); @@ -503,12 +511,13 @@ impl<'a> UtilizeCpiBuilder<'a> { } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> UtilizeCpi<'a> { - let args = UtilizeInstructionArgs::new( - self.instruction + let args = UtilizeInstructionArgs { + number_of_uses: self + .instruction .number_of_uses .clone() .expect("number_of_uses is not set"), - ); + }; UtilizeCpi { __program: self.instruction.__program, diff --git a/clients/rust/src/generated/instructions/verify_collection.rs b/clients/rust/src/generated/instructions/verify_collection.rs index 20003b81..d060ce32 100644 --- a/clients/rust/src/generated/instructions/verify_collection.rs +++ b/clients/rust/src/generated/instructions/verify_collection.rs @@ -29,8 +29,6 @@ pub struct VerifyCollection { impl VerifyCollection { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = VerifyCollectionInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -62,26 +60,27 @@ impl VerifyCollection { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = VerifyCollectionInstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct VerifyCollectionInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct VerifyCollectionInstructionData { discriminator: u8, } -impl VerifyCollectionInstructionArgs { - pub fn new() -> Self { +impl VerifyCollectionInstructionData { + fn new() -> Self { Self { discriminator: 18 } } } @@ -207,8 +206,6 @@ impl<'a> VerifyCollectionCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = VerifyCollectionInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -241,15 +238,16 @@ impl<'a> VerifyCollectionCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = VerifyCollectionInstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/verify_collection_v1.rs b/clients/rust/src/generated/instructions/verify_collection_v1.rs index 3b604ded..7076c707 100644 --- a/clients/rust/src/generated/instructions/verify_collection_v1.rs +++ b/clients/rust/src/generated/instructions/verify_collection_v1.rs @@ -31,8 +31,6 @@ pub struct VerifyCollectionV1 { impl VerifyCollectionV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = VerifyCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -45,7 +43,7 @@ impl VerifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -64,7 +62,7 @@ impl VerifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -75,7 +73,7 @@ impl VerifyCollectionV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -87,23 +85,26 @@ impl VerifyCollectionV1 { self.sysvar_instructions, false, )); + let data = VerifyCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct VerifyCollectionV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct VerifyCollectionV1InstructionData { discriminator: u8, verify_collection_v1_discriminator: u8, } -impl VerifyCollectionV1InstructionArgs { - pub fn new() -> Self { +impl VerifyCollectionV1InstructionData { + fn new() -> Self { Self { discriminator: 52, verify_collection_v1_discriminator: 1, @@ -247,8 +248,6 @@ impl<'a> VerifyCollectionV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = VerifyCollectionV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -261,7 +260,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -280,7 +279,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -291,7 +290,7 @@ impl<'a> VerifyCollectionV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -303,11 +302,14 @@ impl<'a> VerifyCollectionV1Cpi<'a> { *self.sysvar_instructions.key, false, )); + let data = VerifyCollectionV1InstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(8 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/verify_creator_v1.rs b/clients/rust/src/generated/instructions/verify_creator_v1.rs index a3c9196b..016cb424 100644 --- a/clients/rust/src/generated/instructions/verify_creator_v1.rs +++ b/clients/rust/src/generated/instructions/verify_creator_v1.rs @@ -31,8 +31,6 @@ pub struct VerifyCreatorV1 { impl VerifyCreatorV1 { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = VerifyCreatorV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.authority, @@ -45,7 +43,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -60,7 +58,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -71,7 +69,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -82,7 +80,7 @@ impl VerifyCreatorV1 { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -94,23 +92,24 @@ impl VerifyCreatorV1 { self.sysvar_instructions, false, )); + let data = VerifyCreatorV1InstructionData::new().try_to_vec().unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct VerifyCreatorV1InstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct VerifyCreatorV1InstructionData { discriminator: u8, verify_creator_v1_discriminator: u8, } -impl VerifyCreatorV1InstructionArgs { - pub fn new() -> Self { +impl VerifyCreatorV1InstructionData { + fn new() -> Self { Self { discriminator: 52, verify_creator_v1_discriminator: 0, @@ -255,8 +254,6 @@ impl<'a> VerifyCreatorV1Cpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = VerifyCreatorV1InstructionArgs::new(); - let mut accounts = Vec::with_capacity(8); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.authority.key, @@ -269,7 +266,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -284,7 +281,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -295,7 +292,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -306,7 +303,7 @@ impl<'a> VerifyCreatorV1Cpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } @@ -318,11 +315,12 @@ impl<'a> VerifyCreatorV1Cpi<'a> { *self.sysvar_instructions.key, false, )); + let data = VerifyCreatorV1InstructionData::new().try_to_vec().unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(8 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs index f9bdee16..26afce9c 100644 --- a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs @@ -29,8 +29,6 @@ pub struct VerifySizedCollectionItem { impl VerifySizedCollectionItem { #[allow(clippy::vec_init_then_push)] pub fn instruction(&self) -> solana_program::instruction::Instruction { - let args = VerifySizedCollectionItemInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( self.metadata, @@ -62,26 +60,29 @@ impl VerifySizedCollectionItem { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = VerifySizedCollectionItemInstructionData::new() + .try_to_vec() + .unwrap(); solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, } } } -#[derive(BorshSerialize, BorshDeserialize, Debug)] -struct VerifySizedCollectionItemInstructionArgs { +#[derive(BorshDeserialize, BorshSerialize)] +struct VerifySizedCollectionItemInstructionData { discriminator: u8, } -impl VerifySizedCollectionItemInstructionArgs { - pub fn new() -> Self { +impl VerifySizedCollectionItemInstructionData { + fn new() -> Self { Self { discriminator: 30 } } } @@ -207,8 +208,6 @@ impl<'a> VerifySizedCollectionItemCpi<'a> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { - let args = VerifySizedCollectionItemInstructionArgs::new(); - let mut accounts = Vec::with_capacity(7); accounts.push(solana_program::instruction::AccountMeta::new( *self.metadata.key, @@ -241,15 +240,18 @@ impl<'a> VerifySizedCollectionItemCpi<'a> { )); } else { accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::TOKEN_METADATA_ID, + crate::MPL_TOKEN_METADATA_ID, false, )); } + let data = VerifySizedCollectionItemInstructionData::new() + .try_to_vec() + .unwrap(); let instruction = solana_program::instruction::Instruction { - program_id: crate::TOKEN_METADATA_ID, + program_id: crate::MPL_TOKEN_METADATA_ID, accounts, - data: args.try_to_vec().unwrap(), + data, }; let mut account_infos = Vec::with_capacity(7 + 1); account_infos.push(self.__program.clone()); diff --git a/clients/rust/src/generated/programs.rs b/clients/rust/src/generated/programs.rs index cb70b16b..a485a909 100644 --- a/clients/rust/src/generated/programs.rs +++ b/clients/rust/src/generated/programs.rs @@ -7,5 +7,5 @@ use solana_program::{pubkey, pubkey::Pubkey}; -/// `token_metadata` program ID. -pub const TOKEN_METADATA_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); +/// `mpl_token_metadata` program ID. +pub const MPL_TOKEN_METADATA_ID: Pubkey = pubkey!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"); diff --git a/clients/rust/src/lib.rs b/clients/rust/src/lib.rs index 1682e557..e7054d30 100644 --- a/clients/rust/src/lib.rs +++ b/clients/rust/src/lib.rs @@ -1,7 +1,9 @@ mod generated; -pub use generated::*; pub mod hooked; +pub use generated::MPL_TOKEN_METADATA_ID as ID; +pub use generated::*; + /// Removes all null bytes from a string. pub fn clean(value: String) -> String { value.replace('\0', "") diff --git a/clients/rust/tests/create.rs b/clients/rust/tests/create.rs index adb02faa..bad5e1c6 100644 --- a/clients/rust/tests/create.rs +++ b/clients/rust/tests/create.rs @@ -11,16 +11,16 @@ use solana_sdk::{ transaction::Transaction, }; -use mpl_token_metadata_sdk::accounts::MasterEdition; -use mpl_token_metadata_sdk::{ +use mpl_token_metadata::accounts::MasterEdition; +use mpl_token_metadata::{ accounts::Metadata, types::{Key, PrintSupply}, }; -use mpl_token_metadata_sdk::{ +use mpl_token_metadata::{ clean, instructions::{CreateV1, CreateV1InstructionArgs}, }; -use mpl_token_metadata_sdk::{instructions::CreateV1Builder, types::TokenStandard}; +use mpl_token_metadata::{instructions::CreateV1Builder, types::TokenStandard}; mod create { @@ -109,14 +109,22 @@ mod create { // when we create a programmable non-fungible metadata - let mut args = CreateV1InstructionArgs::new( - String::from("pNFT"), - String::from("http://my.pnft"), - 500, - None, - TokenStandard::ProgrammableNonFungible, - ); - args.print_supply = Some(PrintSupply::Zero); + let args = CreateV1InstructionArgs { + name: String::from("pNFT"), + uri: String::from("http://my.pnft"), + symbol: String::from(""), + seller_fee_basis_points: 500, + primary_sale_happened: false, + is_mutable: true, + creators: None, + token_standard: TokenStandard::ProgrammableNonFungible, + collection: None, + collection_details: None, + decimals: Some(0), + print_supply: Some(PrintSupply::Zero), + rule_set: None, + uses: None, + }; let create_ix = CreateV1 { metadata, diff --git a/clients/rust/tests/lock.rs b/clients/rust/tests/lock.rs index 0b212975..d575f6e1 100644 --- a/clients/rust/tests/lock.rs +++ b/clients/rust/tests/lock.rs @@ -8,9 +8,9 @@ use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::transaction::Transaction; use spl_token::state::Account; -use mpl_token_metadata_sdk::instructions::DelegateStandardV1Builder; -use mpl_token_metadata_sdk::instructions::LockV1Builder; -use mpl_token_metadata_sdk::types::TokenStandard; +use mpl_token_metadata::instructions::DelegateStandardV1Builder; +use mpl_token_metadata::instructions::LockV1Builder; +use mpl_token_metadata::types::TokenStandard; mod lock { diff --git a/clients/rust/tests/setup/digital_asset.rs b/clients/rust/tests/setup/digital_asset.rs index b2c63cb8..cf5ec4c9 100644 --- a/clients/rust/tests/setup/digital_asset.rs +++ b/clients/rust/tests/setup/digital_asset.rs @@ -1,4 +1,4 @@ -use mpl_token_metadata_sdk::{ +use mpl_token_metadata::{ accounts::{MasterEdition, Metadata}, instructions::{CreateV1Builder, MintV1Builder}, types::{PrintSupply, TokenStandard}, diff --git a/clients/rust/tests/setup/mod.rs b/clients/rust/tests/setup/mod.rs index 8accb21d..1e2e4804 100644 --- a/clients/rust/tests/setup/mod.rs +++ b/clients/rust/tests/setup/mod.rs @@ -8,14 +8,10 @@ use solana_program::pubkey::Pubkey; use solana_program_test::{ProgramTest, ProgramTestContext}; use solana_sdk::account::Account; -pub const PROGRAM_ID: Pubkey = mpl_token_metadata_sdk::MPL_TOKEN_METADATA_ID; +pub const PROGRAM_ID: Pubkey = mpl_token_metadata::ID; pub fn program_test() -> ProgramTest { - ProgramTest::new( - "mpl_token_metadata", - mpl_token_metadata_sdk::MPL_TOKEN_METADATA_ID, - None, - ) + ProgramTest::new("token_metadata", mpl_token_metadata::ID, None) } pub async fn get_account(context: &mut ProgramTestContext, pubkey: &Pubkey) -> Account { diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index d4f5bed9..1bd3d2d9 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -8,6 +8,14 @@ const idlDir = path.join(__dirname, "..", "idls"); // Instanciate Kinobi. const kinobi = k.createFromIdls([path.join(idlDir, "token_metadata.json")]); +kinobi.update( + new k.UpdateProgramsVisitor({ + tokenMetadata: { + name: "mplTokenMetadata", + }, + }) +); + // Update Accounts. const metadataSeeds = [ k.stringConstantSeed("metadata"), diff --git a/package.json b/package.json index 45e41caa..7990a7bb 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@metaplex-foundation/amman": "^0.12.1", - "@metaplex-foundation/kinobi": "^0.13.0", + "@metaplex-foundation/kinobi": "^0.13.1", "@metaplex-foundation/shank-js": "^0.1.0", "typescript": "^4.9.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d7119e4..890555d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,8 +5,8 @@ devDependencies: specifier: ^0.12.1 version: 0.12.1(typescript@4.9.5) '@metaplex-foundation/kinobi': - specifier: ^0.13.0 - version: 0.13.0 + specifier: ^0.13.1 + version: 0.13.1 '@metaplex-foundation/shank-js': specifier: ^0.1.0 version: 0.1.0 @@ -85,8 +85,8 @@ packages: resolution: {integrity: sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA==} dev: true - /@metaplex-foundation/kinobi@0.13.0: - resolution: {integrity: sha512-jAP4Cm7XVujV+MNGvXc0/xDR7yFxbP7vXivwRVQIxhHG/BGc3lJOCdv2pk3+GB0ZZh+2bLO0NkiCjdcu5oUFXQ==} + /@metaplex-foundation/kinobi@0.13.1: + resolution: {integrity: sha512-b+NuiypU+485whvPAfa9pkca9Ec8z2rMgUoYhqs3qMelz0/VziaxzVJzJPWSOh3IS9HOdXLQHXsU6cxpRh5Vag==} dependencies: '@noble/hashes': 1.2.0 chalk: 4.1.2 From 1e3daa6eef60430c2b99f6b41456ee7c56a85aa9 Mon Sep 17 00:00:00 2001 From: febo Date: Tue, 22 Aug 2023 20:05:07 +0300 Subject: [PATCH 18/31] Bump kinobi version --- clients/rust/src/generated/accounts/mod.rs | 40 ++--- clients/rust/src/generated/errors/mod.rs | 4 +- .../rust/src/generated/instructions/mod.rs | 164 ++++++++--------- clients/rust/src/generated/mod.rs | 2 +- .../rust/src/generated/types/helper/mod.rs | 96 ---------- clients/rust/src/generated/types/mod.rs | 168 +++++++++--------- clients/rust/src/lib.rs | 2 +- package.json | 2 +- pnpm-lock.yaml | 8 +- 9 files changed, 195 insertions(+), 291 deletions(-) delete mode 100644 clients/rust/src/generated/types/helper/mod.rs diff --git a/clients/rust/src/generated/accounts/mod.rs b/clients/rust/src/generated/accounts/mod.rs index a2fd9d0b..7fe23f41 100644 --- a/clients/rust/src/generated/accounts/mod.rs +++ b/clients/rust/src/generated/accounts/mod.rs @@ -5,24 +5,24 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -mod collection_authority_record; -mod edition; -mod edition_marker; -mod edition_marker_v2; -mod master_edition; -mod metadata; -mod metadata_delegate_record; -mod token_owned_escrow; -mod token_record; -mod use_authority_record; +pub mod collection_authority_record; +pub mod edition; +pub mod edition_marker; +pub mod edition_marker_v2; +pub mod master_edition; +pub mod metadata; +pub mod metadata_delegate_record; +pub mod token_owned_escrow; +pub mod token_record; +pub mod use_authority_record; -pub use collection_authority_record::*; -pub use edition::*; -pub use edition_marker::*; -pub use edition_marker_v2::*; -pub use master_edition::*; -pub use metadata::*; -pub use metadata_delegate_record::*; -pub use token_owned_escrow::*; -pub use token_record::*; -pub use use_authority_record::*; +pub use self::collection_authority_record::*; +pub use self::edition::*; +pub use self::edition_marker::*; +pub use self::edition_marker_v2::*; +pub use self::master_edition::*; +pub use self::metadata::*; +pub use self::metadata_delegate_record::*; +pub use self::token_owned_escrow::*; +pub use self::token_record::*; +pub use self::use_authority_record::*; diff --git a/clients/rust/src/generated/errors/mod.rs b/clients/rust/src/generated/errors/mod.rs index b2dd94ed..af3ff710 100644 --- a/clients/rust/src/generated/errors/mod.rs +++ b/clients/rust/src/generated/errors/mod.rs @@ -5,6 +5,6 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -mod mpl_token_metadata; +pub mod mpl_token_metadata; -pub use mpl_token_metadata::MplTokenMetadataError; +pub use self::mpl_token_metadata::MplTokenMetadataError; diff --git a/clients/rust/src/generated/instructions/mod.rs b/clients/rust/src/generated/instructions/mod.rs index fd2136ee..33965ba6 100644 --- a/clients/rust/src/generated/instructions/mod.rs +++ b/clients/rust/src/generated/instructions/mod.rs @@ -88,85 +88,85 @@ pub mod verify_collection_v1; pub mod verify_creator_v1; pub mod verify_sized_collection_item; -pub use approve_collection_authority::*; -pub use approve_use_authority::*; -pub use bubblegum_set_collection_size::*; -pub use burn_edition_nft::*; -pub use burn_nft::*; -pub use burn_v1::*; -pub use close_escrow_account::*; -pub use collect::*; -pub use convert_master_edition_v1_to_v2::*; -pub use create_escrow_account::*; -pub use create_master_edition_v3::*; -pub use create_metadata_account_v3::*; -pub use create_v1::*; -pub use delegate_authority_item_v1::*; -pub use delegate_collection_item_v1::*; -pub use delegate_collection_v1::*; -pub use delegate_data_item_v1::*; -pub use delegate_data_v1::*; -pub use delegate_locked_transfer_v1::*; -pub use delegate_programmable_config_item_v1::*; -pub use delegate_programmable_config_v1::*; -pub use delegate_sale_v1::*; -pub use delegate_staking_v1::*; -pub use delegate_standard_v1::*; -pub use delegate_transfer_v1::*; -pub use delegate_utility_v1::*; -pub use deprecated_mint_new_edition_from_master_edition_via_printing_token::*; -pub use freeze_delegated_account::*; -pub use lock_v1::*; -pub use migrate::*; -pub use mint_new_edition_from_master_edition_via_token::*; -pub use mint_new_edition_from_master_edition_via_vault_proxy::*; -pub use mint_v1::*; -pub use print_v1::*; -pub use puff_metadata::*; -pub use remove_creator_verification::*; -pub use revoke_authority_item_v1::*; -pub use revoke_collection_authority::*; -pub use revoke_collection_item_v1::*; -pub use revoke_collection_v1::*; -pub use revoke_data_item_v1::*; -pub use revoke_data_v1::*; -pub use revoke_locked_transfer_v1::*; -pub use revoke_migration_v1::*; -pub use revoke_programmable_config_item_v1::*; -pub use revoke_programmable_config_v1::*; -pub use revoke_sale_v1::*; -pub use revoke_staking_v1::*; -pub use revoke_standard_v1::*; -pub use revoke_transfer_v1::*; -pub use revoke_use_authority::*; -pub use revoke_utility_v1::*; -pub use set_and_verify_collection::*; -pub use set_and_verify_sized_collection_item::*; -pub use set_collection_size::*; -pub use set_token_standard::*; -pub use sign_metadata::*; -pub use thaw_delegated_account::*; -pub use transfer_out_of_escrow::*; -pub use transfer_v1::*; -pub use unlock_v1::*; -pub use unverify_collection::*; -pub use unverify_collection_v1::*; -pub use unverify_creator_v1::*; -pub use unverify_sized_collection_item::*; -pub use update_as_authority_item_delegate_v2::*; -pub use update_as_collection_delegate_v2::*; -pub use update_as_collection_item_delegate_v2::*; -pub use update_as_data_delegate_v2::*; -pub use update_as_data_item_delegate_v2::*; -pub use update_as_programmable_config_delegate_v2::*; -pub use update_as_programmable_config_item_delegate_v2::*; -pub use update_as_update_authority_v2::*; -pub use update_metadata_account_v2::*; -pub use update_primary_sale_happened_via_token::*; -pub use update_v1::*; -pub use use_v1::*; -pub use utilize::*; -pub use verify_collection::*; -pub use verify_collection_v1::*; -pub use verify_creator_v1::*; -pub use verify_sized_collection_item::*; +pub use self::approve_collection_authority::*; +pub use self::approve_use_authority::*; +pub use self::bubblegum_set_collection_size::*; +pub use self::burn_edition_nft::*; +pub use self::burn_nft::*; +pub use self::burn_v1::*; +pub use self::close_escrow_account::*; +pub use self::collect::*; +pub use self::convert_master_edition_v1_to_v2::*; +pub use self::create_escrow_account::*; +pub use self::create_master_edition_v3::*; +pub use self::create_metadata_account_v3::*; +pub use self::create_v1::*; +pub use self::delegate_authority_item_v1::*; +pub use self::delegate_collection_item_v1::*; +pub use self::delegate_collection_v1::*; +pub use self::delegate_data_item_v1::*; +pub use self::delegate_data_v1::*; +pub use self::delegate_locked_transfer_v1::*; +pub use self::delegate_programmable_config_item_v1::*; +pub use self::delegate_programmable_config_v1::*; +pub use self::delegate_sale_v1::*; +pub use self::delegate_staking_v1::*; +pub use self::delegate_standard_v1::*; +pub use self::delegate_transfer_v1::*; +pub use self::delegate_utility_v1::*; +pub use self::deprecated_mint_new_edition_from_master_edition_via_printing_token::*; +pub use self::freeze_delegated_account::*; +pub use self::lock_v1::*; +pub use self::migrate::*; +pub use self::mint_new_edition_from_master_edition_via_token::*; +pub use self::mint_new_edition_from_master_edition_via_vault_proxy::*; +pub use self::mint_v1::*; +pub use self::print_v1::*; +pub use self::puff_metadata::*; +pub use self::remove_creator_verification::*; +pub use self::revoke_authority_item_v1::*; +pub use self::revoke_collection_authority::*; +pub use self::revoke_collection_item_v1::*; +pub use self::revoke_collection_v1::*; +pub use self::revoke_data_item_v1::*; +pub use self::revoke_data_v1::*; +pub use self::revoke_locked_transfer_v1::*; +pub use self::revoke_migration_v1::*; +pub use self::revoke_programmable_config_item_v1::*; +pub use self::revoke_programmable_config_v1::*; +pub use self::revoke_sale_v1::*; +pub use self::revoke_staking_v1::*; +pub use self::revoke_standard_v1::*; +pub use self::revoke_transfer_v1::*; +pub use self::revoke_use_authority::*; +pub use self::revoke_utility_v1::*; +pub use self::set_and_verify_collection::*; +pub use self::set_and_verify_sized_collection_item::*; +pub use self::set_collection_size::*; +pub use self::set_token_standard::*; +pub use self::sign_metadata::*; +pub use self::thaw_delegated_account::*; +pub use self::transfer_out_of_escrow::*; +pub use self::transfer_v1::*; +pub use self::unlock_v1::*; +pub use self::unverify_collection::*; +pub use self::unverify_collection_v1::*; +pub use self::unverify_creator_v1::*; +pub use self::unverify_sized_collection_item::*; +pub use self::update_as_authority_item_delegate_v2::*; +pub use self::update_as_collection_delegate_v2::*; +pub use self::update_as_collection_item_delegate_v2::*; +pub use self::update_as_data_delegate_v2::*; +pub use self::update_as_data_item_delegate_v2::*; +pub use self::update_as_programmable_config_delegate_v2::*; +pub use self::update_as_programmable_config_item_delegate_v2::*; +pub use self::update_as_update_authority_v2::*; +pub use self::update_metadata_account_v2::*; +pub use self::update_primary_sale_happened_via_token::*; +pub use self::update_v1::*; +pub use self::use_v1::*; +pub use self::utilize::*; +pub use self::verify_collection::*; +pub use self::verify_collection_v1::*; +pub use self::verify_creator_v1::*; +pub use self::verify_sized_collection_item::*; diff --git a/clients/rust/src/generated/mod.rs b/clients/rust/src/generated/mod.rs index 5a39b0d1..1dc8fd1f 100644 --- a/clients/rust/src/generated/mod.rs +++ b/clients/rust/src/generated/mod.rs @@ -11,4 +11,4 @@ pub mod instructions; pub mod programs; pub mod types; -pub use programs::*; +pub(crate) use programs::*; diff --git a/clients/rust/src/generated/types/helper/mod.rs b/clients/rust/src/generated/types/helper/mod.rs deleted file mode 100644 index 1cf7bfa8..00000000 --- a/clients/rust/src/generated/types/helper/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use std::fmt::Debug; -use std::io::Write; -use std::ops::{Deref, DerefMut}; - -use borsh::maybestd::io::Read; -use borsh::{BorshDeserialize, BorshSerialize}; - -/// A vector that deserializes from a stream of bytes. -/// -/// This is useful for deserializing a vector that does not have -/// a length prefix. In order to determine how many elements to deserialize, -/// the type of the elements must implement the trait `Sized`. -pub struct RemainderVec(Vec); - -/// Deferences the inner `Vec` type. -impl Deref for RemainderVec -where - T: BorshSerialize + BorshDeserialize, -{ - type Target = Vec; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -/// Deferences the inner `Vec` type as mutable. -impl DerefMut for RemainderVec -where - T: BorshSerialize + BorshDeserialize, -{ - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -/// `Debug` implementation for `RemainderVec`. -/// -/// This implementation simply forwards to the inner `Vec` type. -impl Debug for RemainderVec -where - T: BorshSerialize + BorshDeserialize + Debug, -{ - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_fmt(format_args!("{:?}", self.0)) - } -} - -impl BorshDeserialize for RemainderVec -where - T: BorshSerialize + BorshDeserialize, -{ - fn deserialize_reader(reader: &mut R) -> borsh::maybestd::io::Result { - let length = std::mem::size_of::(); - // buffer to read the data - let mut buffer = vec![0u8; length]; - // vec to store the items - let mut items: Vec = Vec::new(); - - loop { - match reader.read(&mut buffer)? { - 0 => break, - n if n == length => items.push(T::deserialize(&mut buffer.as_slice())?), - e => { - return Err(borsh::maybestd::io::Error::new( - borsh::maybestd::io::ErrorKind::InvalidData, - format!("unexpected number of bytes (read {e}, expected {length})"), - )) - } - } - } - - Ok(Self(items)) - } -} - -impl BorshSerialize for RemainderVec -where - T: BorshSerialize + BorshDeserialize, -{ - fn serialize(&self, writer: &mut W) -> borsh::maybestd::io::Result<()> { - // serialize each item without adding a prefix for the length - for item in self.0.iter() { - item.serialize(writer)?; - } - - Ok(()) - } -} diff --git a/clients/rust/src/generated/types/mod.rs b/clients/rust/src/generated/types/mod.rs index cad0b17c..b481e047 100644 --- a/clients/rust/src/generated/types/mod.rs +++ b/clients/rust/src/generated/types/mod.rs @@ -5,88 +5,88 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -mod authority_type; -mod authorization_data; -mod burn_args; -mod collection; -mod collection_details; -mod collection_details_toggle; -mod collection_toggle; -mod create_args; -mod creator; -mod data_v2; -mod delegate_args; -mod escrow_authority; -mod key; -mod leaf_info; -mod lock_args; -mod metadata_delegate_role; -mod migration_type; -mod mint_args; -mod mint_new_edition_from_master_edition_via_token_args; -mod payload; -mod payload_key; -mod payload_type; -mod print_args; -mod print_supply; -mod programmable_config; -mod reservation; -mod reservation_v1; -mod revoke_args; -mod rule_set_toggle; -mod seeds_vec; -mod set_collection_size_args; -mod token_delegate_role; -mod token_standard; -mod token_state; -mod transfer_args; -mod unlock_args; -mod update_args; -mod use_args; -mod use_method; -mod uses; -mod uses_toggle; -mod verification_args; +pub mod authority_type; +pub mod authorization_data; +pub mod burn_args; +pub mod collection; +pub mod collection_details; +pub mod collection_details_toggle; +pub mod collection_toggle; +pub mod create_args; +pub mod creator; +pub mod data_v2; +pub mod delegate_args; +pub mod escrow_authority; +pub mod key; +pub mod leaf_info; +pub mod lock_args; +pub mod metadata_delegate_role; +pub mod migration_type; +pub mod mint_args; +pub mod mint_new_edition_from_master_edition_via_token_args; +pub mod payload; +pub mod payload_key; +pub mod payload_type; +pub mod print_args; +pub mod print_supply; +pub mod programmable_config; +pub mod reservation; +pub mod reservation_v1; +pub mod revoke_args; +pub mod rule_set_toggle; +pub mod seeds_vec; +pub mod set_collection_size_args; +pub mod token_delegate_role; +pub mod token_standard; +pub mod token_state; +pub mod transfer_args; +pub mod unlock_args; +pub mod update_args; +pub mod use_args; +pub mod use_method; +pub mod uses; +pub mod uses_toggle; +pub mod verification_args; -pub use authority_type::*; -pub use authorization_data::*; -pub use burn_args::*; -pub use collection::*; -pub use collection_details::*; -pub use collection_details_toggle::*; -pub use collection_toggle::*; -pub use create_args::*; -pub use creator::*; -pub use data_v2::*; -pub use delegate_args::*; -pub use escrow_authority::*; -pub use key::*; -pub use leaf_info::*; -pub use lock_args::*; -pub use metadata_delegate_role::*; -pub use migration_type::*; -pub use mint_args::*; -pub use mint_new_edition_from_master_edition_via_token_args::*; -pub use payload::*; -pub use payload_key::*; -pub use payload_type::*; -pub use print_args::*; -pub use print_supply::*; -pub use programmable_config::*; -pub use reservation::*; -pub use reservation_v1::*; -pub use revoke_args::*; -pub use rule_set_toggle::*; -pub use seeds_vec::*; -pub use set_collection_size_args::*; -pub use token_delegate_role::*; -pub use token_standard::*; -pub use token_state::*; -pub use transfer_args::*; -pub use unlock_args::*; -pub use update_args::*; -pub use use_args::*; -pub use use_method::*; -pub use uses::*; -pub use uses_toggle::*; -pub use verification_args::*; +pub use self::authority_type::*; +pub use self::authorization_data::*; +pub use self::burn_args::*; +pub use self::collection::*; +pub use self::collection_details::*; +pub use self::collection_details_toggle::*; +pub use self::collection_toggle::*; +pub use self::create_args::*; +pub use self::creator::*; +pub use self::data_v2::*; +pub use self::delegate_args::*; +pub use self::escrow_authority::*; +pub use self::key::*; +pub use self::leaf_info::*; +pub use self::lock_args::*; +pub use self::metadata_delegate_role::*; +pub use self::migration_type::*; +pub use self::mint_args::*; +pub use self::mint_new_edition_from_master_edition_via_token_args::*; +pub use self::payload::*; +pub use self::payload_key::*; +pub use self::payload_type::*; +pub use self::print_args::*; +pub use self::print_supply::*; +pub use self::programmable_config::*; +pub use self::reservation::*; +pub use self::reservation_v1::*; +pub use self::revoke_args::*; +pub use self::rule_set_toggle::*; +pub use self::seeds_vec::*; +pub use self::set_collection_size_args::*; +pub use self::token_delegate_role::*; +pub use self::token_standard::*; +pub use self::token_state::*; +pub use self::transfer_args::*; +pub use self::unlock_args::*; +pub use self::update_args::*; +pub use self::use_args::*; +pub use self::use_method::*; +pub use self::uses::*; +pub use self::uses_toggle::*; +pub use self::verification_args::*; diff --git a/clients/rust/src/lib.rs b/clients/rust/src/lib.rs index e7054d30..e0ec41fc 100644 --- a/clients/rust/src/lib.rs +++ b/clients/rust/src/lib.rs @@ -1,7 +1,7 @@ mod generated; pub mod hooked; -pub use generated::MPL_TOKEN_METADATA_ID as ID; +pub use generated::programs::MPL_TOKEN_METADATA_ID as ID; pub use generated::*; /// Removes all null bytes from a string. diff --git a/package.json b/package.json index 7990a7bb..e36b330b 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@metaplex-foundation/amman": "^0.12.1", - "@metaplex-foundation/kinobi": "^0.13.1", + "@metaplex-foundation/kinobi": "^0.13.2", "@metaplex-foundation/shank-js": "^0.1.0", "typescript": "^4.9.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 890555d3..2922689b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,8 +5,8 @@ devDependencies: specifier: ^0.12.1 version: 0.12.1(typescript@4.9.5) '@metaplex-foundation/kinobi': - specifier: ^0.13.1 - version: 0.13.1 + specifier: ^0.13.2 + version: 0.13.2 '@metaplex-foundation/shank-js': specifier: ^0.1.0 version: 0.1.0 @@ -85,8 +85,8 @@ packages: resolution: {integrity: sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA==} dev: true - /@metaplex-foundation/kinobi@0.13.1: - resolution: {integrity: sha512-b+NuiypU+485whvPAfa9pkca9Ec8z2rMgUoYhqs3qMelz0/VziaxzVJzJPWSOh3IS9HOdXLQHXsU6cxpRh5Vag==} + /@metaplex-foundation/kinobi@0.13.2: + resolution: {integrity: sha512-y2T7lySApu2hD0hy/Y+oe5lGBHWxugZIfLrTn8LqAhFcxISMqEZj2yvcCYVSr2obIXKDeMEpHJsP43AULdd4mA==} dependencies: '@noble/hashes': 1.2.0 chalk: 4.1.2 From 4baff1b71069ba932049b81888796a007f2e1430 Mon Sep 17 00:00:00 2001 From: febo Date: Tue, 22 Aug 2023 17:10:51 +0000 Subject: [PATCH 19/31] Update generated clients --- .../generated/accounts/edition_marker_v2.rs | 32 +++++++++++ .../src/generated/instructions/print_v1.rs | 56 +++++++++++-------- 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/clients/rust/src/generated/accounts/edition_marker_v2.rs b/clients/rust/src/generated/accounts/edition_marker_v2.rs index 0110de99..4732e702 100644 --- a/clients/rust/src/generated/accounts/edition_marker_v2.rs +++ b/clients/rust/src/generated/accounts/edition_marker_v2.rs @@ -8,6 +8,7 @@ use crate::generated::types::Key; use borsh::BorshDeserialize; use borsh::BorshSerialize; +use solana_program::pubkey::Pubkey; #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] pub struct EditionMarkerV2 { @@ -15,6 +16,37 @@ pub struct EditionMarkerV2 { pub ledger: Vec, } +impl EditionMarkerV2 { + pub fn find_pda(mint: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { + solana_program::pubkey::Pubkey::find_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "edition".as_bytes(), + "marker".as_bytes(), + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } + pub fn create_pda( + mint: Pubkey, + bump: u8, + ) -> Result { + solana_program::pubkey::Pubkey::create_program_address( + &[ + "metadata".as_bytes(), + crate::MPL_TOKEN_METADATA_ID.as_ref(), + mint.as_ref(), + "edition".as_bytes(), + "marker".as_bytes(), + &[bump], + ], + &crate::MPL_TOKEN_METADATA_ID, + ) + } +} + impl<'a> TryFrom<&'a solana_program::account_info::AccountInfo<'a>> for EditionMarkerV2 { type Error = std::io::Error; diff --git a/clients/rust/src/generated/instructions/print_v1.rs b/clients/rust/src/generated/instructions/print_v1.rs index 2354e46c..c8be17ef 100644 --- a/clients/rust/src/generated/instructions/print_v1.rs +++ b/clients/rust/src/generated/instructions/print_v1.rs @@ -15,7 +15,7 @@ pub struct PrintV1 { /// New Edition (pda of ['metadata', program id, mint id, 'edition']) pub edition: solana_program::pubkey::Pubkey, /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY - pub edition_mint: solana_program::pubkey::Pubkey, + pub edition_mint: (solana_program::pubkey::Pubkey, bool), /// Owner of the token account of new token pub edition_token_account_owner: solana_program::pubkey::Pubkey, /// Token account of new token @@ -64,8 +64,8 @@ impl PrintV1 { false, )); accounts.push(solana_program::instruction::AccountMeta::new( - self.edition_mint, - false, + self.edition_mint.0, + self.edition_mint.1, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.edition_token_account_owner, @@ -162,7 +162,7 @@ impl PrintV1InstructionData { #[derive(BorshSerialize, BorshDeserialize, Debug)] pub struct PrintV1InstructionArgs { - pub edition_arg: u64, + pub edition_number: u64, } /// Instruction builder. @@ -170,7 +170,7 @@ pub struct PrintV1InstructionArgs { pub struct PrintV1Builder { edition_metadata: Option, edition: Option, - edition_mint: Option, + edition_mint: Option<(solana_program::pubkey::Pubkey, bool)>, edition_token_account_owner: Option, edition_token_account: Option, edition_mint_authority: Option, @@ -186,7 +186,7 @@ pub struct PrintV1Builder { spl_ata_program: Option, sysvar_instructions: Option, system_program: Option, - edition_arg: Option, + edition_number: Option, } impl PrintV1Builder { @@ -210,8 +210,12 @@ impl PrintV1Builder { } /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY #[inline(always)] - pub fn edition_mint(&mut self, edition_mint: solana_program::pubkey::Pubkey) -> &mut Self { - self.edition_mint = Some(edition_mint); + pub fn edition_mint( + &mut self, + edition_mint: solana_program::pubkey::Pubkey, + as_signer: bool, + ) -> &mut Self { + self.edition_mint = Some((edition_mint, as_signer)); self } /// Owner of the token account of new token @@ -342,8 +346,8 @@ impl PrintV1Builder { self } #[inline(always)] - pub fn edition_arg(&mut self, edition_arg: u64) -> &mut Self { - self.edition_arg = Some(edition_arg); + pub fn edition_number(&mut self, edition_number: u64) -> &mut Self { + self.edition_number = Some(edition_number); self } #[allow(clippy::clone_on_copy)] @@ -389,7 +393,10 @@ impl PrintV1Builder { .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), }; let args = PrintV1InstructionArgs { - edition_arg: self.edition_arg.clone().expect("edition_arg is not set"), + edition_number: self + .edition_number + .clone() + .expect("edition_number is not set"), }; accounts.instruction(args) @@ -405,7 +412,7 @@ pub struct PrintV1Cpi<'a> { /// New Edition (pda of ['metadata', program id, mint id, 'edition']) pub edition: &'a solana_program::account_info::AccountInfo<'a>, /// Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY - pub edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + pub edition_mint: (&'a solana_program::account_info::AccountInfo<'a>, bool), /// Owner of the token account of new token pub edition_token_account_owner: &'a solana_program::account_info::AccountInfo<'a>, /// Token account of new token @@ -460,8 +467,8 @@ impl<'a> PrintV1Cpi<'a> { false, )); accounts.push(solana_program::instruction::AccountMeta::new( - *self.edition_mint.key, - false, + *self.edition_mint.0.key, + self.edition_mint.1, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.edition_token_account_owner.key, @@ -543,7 +550,7 @@ impl<'a> PrintV1Cpi<'a> { account_infos.push(self.__program.clone()); account_infos.push(self.edition_metadata.clone()); account_infos.push(self.edition.clone()); - account_infos.push(self.edition_mint.clone()); + account_infos.push(self.edition_mint.0.clone()); account_infos.push(self.edition_token_account_owner.clone()); account_infos.push(self.edition_token_account.clone()); account_infos.push(self.edition_mint_authority.clone()); @@ -597,7 +604,7 @@ impl<'a> PrintV1CpiBuilder<'a> { spl_ata_program: None, sysvar_instructions: None, system_program: None, - edition_arg: None, + edition_number: None, }); Self { instruction } } @@ -624,8 +631,9 @@ impl<'a> PrintV1CpiBuilder<'a> { pub fn edition_mint( &mut self, edition_mint: &'a solana_program::account_info::AccountInfo<'a>, + as_signer: bool, ) -> &mut Self { - self.instruction.edition_mint = Some(edition_mint); + self.instruction.edition_mint = Some((edition_mint, as_signer)); self } /// Owner of the token account of new token @@ -762,18 +770,18 @@ impl<'a> PrintV1CpiBuilder<'a> { self } #[inline(always)] - pub fn edition_arg(&mut self, edition_arg: u64) -> &mut Self { - self.instruction.edition_arg = Some(edition_arg); + pub fn edition_number(&mut self, edition_number: u64) -> &mut Self { + self.instruction.edition_number = Some(edition_number); self } #[allow(clippy::clone_on_copy)] pub fn build(&self) -> PrintV1Cpi<'a> { let args = PrintV1InstructionArgs { - edition_arg: self + edition_number: self .instruction - .edition_arg + .edition_number .clone() - .expect("edition_arg is not set"), + .expect("edition_number is not set"), }; PrintV1Cpi { @@ -868,7 +876,7 @@ struct PrintV1CpiBuilderInstruction<'a> { __program: &'a solana_program::account_info::AccountInfo<'a>, edition_metadata: Option<&'a solana_program::account_info::AccountInfo<'a>>, edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, - edition_mint: Option<&'a solana_program::account_info::AccountInfo<'a>>, + edition_mint: Option<(&'a solana_program::account_info::AccountInfo<'a>, bool)>, edition_token_account_owner: Option<&'a solana_program::account_info::AccountInfo<'a>>, edition_token_account: Option<&'a solana_program::account_info::AccountInfo<'a>>, edition_mint_authority: Option<&'a solana_program::account_info::AccountInfo<'a>>, @@ -884,5 +892,5 @@ struct PrintV1CpiBuilderInstruction<'a> { spl_ata_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, sysvar_instructions: Option<&'a solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, - edition_arg: Option, + edition_number: Option, } From bb72d5ee1dca601afef717134badf64b2411a66d Mon Sep 17 00:00:00 2001 From: febo Date: Tue, 22 Aug 2023 21:08:42 +0300 Subject: [PATCH 20/31] Update examples --- clients/rust/README.md | 150 ++++++++++++++++++++++++++--------------- 1 file changed, 97 insertions(+), 53 deletions(-) diff --git a/clients/rust/README.md b/clients/rust/README.md index 912c0b61..ee52309b 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -2,7 +2,7 @@ Metaplex Token Metadata SDK

- Rust library for interacting with Token Metadata program. + Rust library for interacting with Metaplex Token Metadata program.

@@ -58,20 +58,34 @@ pub struct CreateV1 { After filling in the instruction account fields, you can use the `instruction(...)` method to generate the corresponding `solana_program::instruction::Instruction`: ```rust // instruction args -let mut args = CreateV1InstructionArgs::new( - String::from("pNFT"), - String::from("http://my.pnft"), - 500, - None, - TokenStandard::ProgrammableNonFungible, -); -args.print_supply = Some(PrintSupply::Zero); +let args = CreateV1InstructionArgs { + name: String::from("pNFT"), + symbol: String::from(""), + uri: String::from("http://my.pnft"), + seller_fee_basis_points: 500, + primary_sale_happened: false, + is_mutable: true, + token_standard: TokenStandard::ProgrammableNonFungible, + collection: None, + uses: None, + collection_details: None, + creators: None, + rule_set: None, + decimals: Some(0), + print_supply: Some(PrintSupply::Zero), +}; // instruction accounts -let create_accounts = CreateV1 { +let create_ix = CreateV1 { metadata, master_edition: Some(master_edition), - ... + mint: (mint_pubkey, true), + authority: payer_pubkey, + payer: payer_pubkey, + update_authority: (payer_pubkey, true), + system_program: system_program::ID, + sysvar_instructions: solana_program::sysvar::instructions::ID, + spl_token_program: spl_token::ID, }; // creates the instruction @@ -99,80 +113,110 @@ let create_ix = CreateV1Builder::new() ### _CPI_ instruction builders -These are builders to be used by on-chain code, which will CPI into Token Metadata. Following the same example as above, we have a `CreateV1Cpi` struct: +These are builders to be used by on-chain code, which will CPI into Token Metadata. Similarly to "off-chain" builders, each instruction has a CPI struct to facilitate invoke CPI instructions – e.g., `TransferV1Cpi`: ```rust -pub struct CreateV1Cpi<'a> { +pub struct TransferV1Cpi<'a> { /// The program to invoke. pub __program: &'a solana_program::account_info::AccountInfo<'a>, - /// Unallocated metadata account with address as pda of ['metadata', program id, mint id] - pub metadata: &'a solana_program::account_info::AccountInfo<'a>, - /// Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition'] - pub master_edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token account + pub token: &'a solana_program::account_info::AccountInfo<'a>, + /// Token account owner + pub token_owner: &'a solana_program::account_info::AccountInfo<'a>, + /// Destination token account + pub destination_token: &'a solana_program::account_info::AccountInfo<'a>, + /// Destination token account owner + pub destination_owner: &'a solana_program::account_info::AccountInfo<'a>, /// Mint of token asset - pub mint: (&'a solana_program::account_info::AccountInfo<'a>, bool), - /// Mint authority + pub mint: &'a solana_program::account_info::AccountInfo<'a>, + /// Metadata (pda of ['metadata', program id, mint id]) + pub metadata: &'a solana_program::account_info::AccountInfo<'a>, + /// Edition of token asset + pub edition: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Owner token record account + pub token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Destination token record account + pub destination_token_record: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Transfer authority (token owner or delegate) pub authority: &'a solana_program::account_info::AccountInfo<'a>, /// Payer pub payer: &'a solana_program::account_info::AccountInfo<'a>, - /// Update authority for the metadata account - pub update_authority: (&'a solana_program::account_info::AccountInfo<'a>, bool), - /// System program + /// System Program pub system_program: &'a solana_program::account_info::AccountInfo<'a>, /// Instructions sysvar account pub sysvar_instructions: &'a solana_program::account_info::AccountInfo<'a>, - /// SPL Token program + /// SPL Token Program pub spl_token_program: &'a solana_program::account_info::AccountInfo<'a>, + /// SPL Associated Token Account program + pub spl_ata_program: &'a solana_program::account_info::AccountInfo<'a>, + /// Token Authorization Rules Program + pub authorization_rules_program: Option<&'a solana_program::account_info::AccountInfo<'a>>, + /// Token Authorization Rules account + pub authorization_rules: Option<&'a solana_program::account_info::AccountInfo<'a>>, /// The arguments for the instruction. - pub __args: CreateV1InstructionArgs, + pub __args: TransferV1InstructionArgs, } ``` After filling in the instruction account info and argument fields, you can use the `invoke()` or `invoke_signed(...)` method to perform the CPI: ```rust // instruction args -let mut args = CreateV1InstructionArgs::new( - String::from("pNFT"), - String::from("http://my.pnft"), - 500, - None, - TokenStandard::ProgrammableNonFungible, -); -args.print_supply = Some(PrintSupply::Zero); +let mut args = TransferV1InstructionArgs { + amount, + authorization_data: None, +}; // instruction accounts -let cpi_create = CreateV1Cpi { - __program: ctx.accounts.token_metadata_program, - metadata: ctx.accounts.metadata, - master_edition: Some(ctx.accounts.master_edition), - ... +let cpi_transfer = TransferV1Cpi { + __program: ctx.accounts.metadata_program, __args: args, + token: ctx.accounts.owner_token, + token_owner: ctx.accounts.owner, + destination_token: ctx.accounts.destination_token, + destination_owner: ctx.accounts.destination, + mint: ctx.accounts.mint, + metadata: ctx.accounts.metadata, + authority: ctx.accounts.vault, + payer: ctx.accounts.payer, + system_program: ctx.accounts.system_program, + sysvar_instructions: ctx.accounts.sysvar_instructions, + spl_token_program: ctx.accounts.spl_token_program, + spl_ata_program: ctx.accounts.spl_ata_program, + edition: ctx.accounts.edition, + token_record: ctx.accounts.owner_token_record, + destination_token_record: ctx.accounts.destination_token_record, + authorization_rules: ctx.accounts.authorization_rules, + authorization_rules_program: ctx.accounts.authorization_rules_program, }; // performs the CPI -cpi_create.invoke()?; +cpi_transfer.invoke_signed(&[&signer_seeds]) ``` -You can also use the `CreateV1CpiBuilder` to simplify the process: +You can also use the `TransferV1CpiBuilder` to simplify the process: ```rust -let cpi_create = CreateV1CpiBuilder::new(ctx.accounts.token_metadata_program) +let cpi_transfer = TransferV1CpiBuilder::new(ctx.accounts.metadata_program) + .token(ctx.accounts.owner_token) + .token_owner(ctx.accounts.owner) + .destination_token(ctx.accounts.destination_token) + .destination_owner(ctx.accounts.destination) + .mint(ctx.accounts.mint) .metadata(ctx.accounts.metadata) - .master_edition(ctx.accounts.master_edition) - .mint(ctx.accounts.mint_pubkey, true) - .authority(ctx.accounts.payer_pubkey) - .payer(ctx.accounts.payer_pubkey) - .update_authority(ctx.accounts.payer_pubkey, true) + .edition(edition) + .token_record(token_record) + .destination_token_record(token_record) + .authority(ctx.accounts.vault) + .payer(ctx.accounts.payer) .system_program(ctx.accounts.system_program) .sysvar_instructions(ctx.accounts.sysvar_instructions) .spl_token_program(ctx.accounts.spl_token_program) - .is_mutable(true) - .primary_sale_happened(false) - .name(String::from("pNFT")) - .uri(String::from("http://my.pnft")) - .seller_fee_basis_points(500) - .token_standard(TokenStandard::ProgrammableNonFungible) - .print_supply(PrintSupply::Zero) + .spl_ata_program(ctx.accounts.spl_ata_program) + .authorization_rules(authorization_rules) + .authorization_rules_program(authorization_rules_program) + .amount(amount) .build(); -cpi_create.invoke()?; + +// performs the CPI +cpi_transfer.invoke_signed(&[&signer_seeds]) ``` ## PDA helpers From 23238e3668b34c2838fce7de9773b8fbea5e6055 Mon Sep 17 00:00:00 2001 From: febo Date: Wed, 23 Aug 2023 00:35:22 +0300 Subject: [PATCH 21/31] Add note on builders --- clients/rust/README.md | 77 +++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/clients/rust/README.md b/clients/rust/README.md index ee52309b..acfe90d5 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -27,7 +27,7 @@ From your project folder: ## Instruction Builders -One of the main features of the client SDK is to facilitate the creation of instructions. There are two "types" of instruction builders automatically generated – both support passing accounts by name and optional positional accounts. +One of the main features of the client SDK is to facilitate the creation of instructions. There are two "types" of instruction builders automatically generated – both support passing accounts by name and optional positional ### _Client_ instruction builders @@ -89,7 +89,7 @@ let create_ix = CreateV1 { }; // creates the instruction -let create_ix = create_accounts.instruction(args); +let create_ix = create_instruction(args); ``` Alternatively, you can use the `CreateV1Builder` to create the appropriate instruction: @@ -113,7 +113,7 @@ let create_ix = CreateV1Builder::new() ### _CPI_ instruction builders -These are builders to be used by on-chain code, which will CPI into Token Metadata. Similarly to "off-chain" builders, each instruction has a CPI struct to facilitate invoke CPI instructions – e.g., `TransferV1Cpi`: +These are builders to be used by on-chain code, which will CPI into Token Metadata. Similarly to "off-chain" builders, each instruction has a struct to invoke CPI instructions – e.g., `TransferV1Cpi`: ```rust pub struct TransferV1Cpi<'a> { /// The program to invoke. @@ -167,25 +167,25 @@ let mut args = TransferV1InstructionArgs { // instruction accounts let cpi_transfer = TransferV1Cpi { - __program: ctx.accounts.metadata_program, + __program: metadata_program_info, __args: args, - token: ctx.accounts.owner_token, - token_owner: ctx.accounts.owner, - destination_token: ctx.accounts.destination_token, - destination_owner: ctx.accounts.destination, - mint: ctx.accounts.mint, - metadata: ctx.accounts.metadata, - authority: ctx.accounts.vault, - payer: ctx.accounts.payer, - system_program: ctx.accounts.system_program, - sysvar_instructions: ctx.accounts.sysvar_instructions, - spl_token_program: ctx.accounts.spl_token_program, - spl_ata_program: ctx.accounts.spl_ata_program, - edition: ctx.accounts.edition, - token_record: ctx.accounts.owner_token_record, - destination_token_record: ctx.accounts.destination_token_record, - authorization_rules: ctx.accounts.authorization_rules, - authorization_rules_program: ctx.accounts.authorization_rules_program, + token: owner_token_info, + token_owner: owner_info, + destination_token: destination_token_info, + destination_owner: destination_info, + mint: mint_info, + metadata: metadata_info, + authority: vault_info, + payer: payer_info, + system_program: system_program_info, + sysvar_instructions: sysvar_instructions_info, + spl_token_program: spl_token_program_info, + spl_ata_program: spl_ata_program_info, + edition: edition_info, + token_record: None, + destination_token_record: None, + authorization_rules: None, + authorization_rules_program: None, }; // performs the CPI @@ -194,24 +194,20 @@ cpi_transfer.invoke_signed(&[&signer_seeds]) You can also use the `TransferV1CpiBuilder` to simplify the process: ```rust -let cpi_transfer = TransferV1CpiBuilder::new(ctx.accounts.metadata_program) - .token(ctx.accounts.owner_token) - .token_owner(ctx.accounts.owner) - .destination_token(ctx.accounts.destination_token) - .destination_owner(ctx.accounts.destination) - .mint(ctx.accounts.mint) - .metadata(ctx.accounts.metadata) - .edition(edition) - .token_record(token_record) - .destination_token_record(token_record) - .authority(ctx.accounts.vault) - .payer(ctx.accounts.payer) - .system_program(ctx.accounts.system_program) - .sysvar_instructions(ctx.accounts.sysvar_instructions) - .spl_token_program(ctx.accounts.spl_token_program) - .spl_ata_program(ctx.accounts.spl_ata_program) - .authorization_rules(authorization_rules) - .authorization_rules_program(authorization_rules_program) +let cpi_transfer = TransferV1CpiBuilder::new(metadata_program_info) + .token(owner_token_info) + .token_owner(owner_info) + .destination_token(destination_token_info) + .destination_owner(destination_info) + .mint(mint_info) + .metadata(metadata_info) + .edition(edition_info) + .authority(vault_info) + .payer(payer_info) + .system_program(system_program_info) + .sysvar_instructions(sysvar_instructions_info) + .spl_token_program(spl_token_program_info) + .spl_ata_program(spl_ata_program_info) .amount(amount) .build(); @@ -219,6 +215,9 @@ let cpi_transfer = TransferV1CpiBuilder::new(ctx.accounts.metadata_program) cpi_transfer.invoke_signed(&[&signer_seeds]) ``` +> **Note** +> `*Builder` provide a simplified way to create the required structs, since they take advantage of any default value set on the Kinobi config and do not require to set a `None` value to optional fields. + ## PDA helpers Account types (e.g., `Metadata`) have associated functions to find PDA or to create PDA `Pubkey`s: From d8bddee94cf4470c6ec180502c6d5b7c12a37573 Mon Sep 17 00:00:00 2001 From: febo Date: Wed, 23 Aug 2023 00:48:21 +0300 Subject: [PATCH 22/31] Increase compute units --- clients/js/test/printV1.test.ts | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/clients/js/test/printV1.test.ts b/clients/js/test/printV1.test.ts index 01d74f8f..98f60fc6 100644 --- a/clients/js/test/printV1.test.ts +++ b/clients/js/test/printV1.test.ts @@ -1,5 +1,10 @@ import { createMintWithAssociatedToken } from '@metaplex-foundation/mpl-toolbox'; -import { generateSigner, percentAmount, some } from '@metaplex-foundation/umi'; +import { + generateSigner, + percentAmount, + some, + transactionBuilder, +} from '@metaplex-foundation/umi'; import test from 'ava'; import { DigitalAsset, @@ -12,6 +17,7 @@ import { printV1, } from '../src'; import { createDigitalAssetWithToken, createUmi } from './_setup'; +import { ComputeBudgetProgram } from '@solana/web3.js'; test('it can print a new edition from a NonFungible', async (t) => { // Given an existing master edition asset. @@ -88,14 +94,23 @@ test('it can print a new edition from a ProgrammableNonFungible', async (t) => { // When we print a new edition of the asset. const editionMint = generateSigner(umi); const editionOwner = generateSigner(umi); - await printV1(umi, { - masterTokenAccountOwner: originalOwner, - masterEditionMint: originalMint.publicKey, - editionMint, - editionTokenAccountOwner: editionOwner.publicKey, - editionNumber: 1, - tokenStandard: TokenStandard.ProgrammableNonFungible, - }).sendAndConfirm(umi); + await transactionBuilder() + .add( + ComputeBudgetProgram.setComputeUnitLimit({ + units: 400_000, + }) + ) + .add( + printV1(umi, { + masterTokenAccountOwner: originalOwner, + masterEditionMint: originalMint.publicKey, + editionMint, + editionTokenAccountOwner: editionOwner.publicKey, + editionNumber: 1, + tokenStandard: TokenStandard.ProgrammableNonFungible, + }) + ) + .sendAndConfirm(umi); // Then the original NFT was updated. const originalAsset = await fetchDigitalAsset(umi, originalMint.publicKey); From 0e53c7d3da7665983f531ac4a9edc0414269c084 Mon Sep 17 00:00:00 2001 From: febo Date: Wed, 23 Aug 2023 01:06:00 +0300 Subject: [PATCH 23/31] Fix print test --- clients/js/test/printV1.test.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/clients/js/test/printV1.test.ts b/clients/js/test/printV1.test.ts index 98f60fc6..44d0d8ad 100644 --- a/clients/js/test/printV1.test.ts +++ b/clients/js/test/printV1.test.ts @@ -1,4 +1,7 @@ -import { createMintWithAssociatedToken } from '@metaplex-foundation/mpl-toolbox'; +import { + createMintWithAssociatedToken, + setComputeUnitLimit, +} from '@metaplex-foundation/mpl-toolbox'; import { generateSigner, percentAmount, @@ -17,7 +20,6 @@ import { printV1, } from '../src'; import { createDigitalAssetWithToken, createUmi } from './_setup'; -import { ComputeBudgetProgram } from '@solana/web3.js'; test('it can print a new edition from a NonFungible', async (t) => { // Given an existing master edition asset. @@ -95,11 +97,7 @@ test('it can print a new edition from a ProgrammableNonFungible', async (t) => { const editionMint = generateSigner(umi); const editionOwner = generateSigner(umi); await transactionBuilder() - .add( - ComputeBudgetProgram.setComputeUnitLimit({ - units: 400_000, - }) - ) + .add(setComputeUnitLimit(umi, { units: 400_000 })) .add( printV1(umi, { masterTokenAccountOwner: originalOwner, From 693f3f896ed1c66ec1a04bf4a5a6f793056a4383 Mon Sep 17 00:00:00 2001 From: febo Date: Wed, 23 Aug 2023 09:11:16 +0300 Subject: [PATCH 24/31] Rename client workflows --- .../{build-sdk.yml => build-rust-client.yml} | 2 +- .github/workflows/main.yml | 12 ++++++------ .../workflows/{test-js.yml => test-js-client.yml} | 0 .../workflows/{test-sdk.yml => test-rust-client.yml} | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename .github/workflows/{build-sdk.yml => build-rust-client.yml} (98%) rename .github/workflows/{test-js.yml => test-js-client.yml} (100%) rename .github/workflows/{test-sdk.yml => test-rust-client.yml} (97%) diff --git a/.github/workflows/build-sdk.yml b/.github/workflows/build-rust-client.yml similarity index 98% rename from .github/workflows/build-sdk.yml rename to .github/workflows/build-rust-client.yml index 77dbc102..616ca981 100644 --- a/.github/workflows/build-sdk.yml +++ b/.github/workflows/build-rust-client.yml @@ -1,4 +1,4 @@ -name: Build Programs +name: Build Rust Client on: workflow_call: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f8b27d9..cd2a1732 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,23 +99,23 @@ jobs: with: filters: .github/file-filters.yml - test_js: + test_js_client: if: needs.generate_clients.outputs.js_changed == 'true' name: JS Client needs: generate_clients - uses: ./.github/workflows/test-js.yml + uses: ./.github/workflows/test-js-client.yml secrets: inherit - build_sdk: + build_rust_client: if: needs.generate_clients.outputs.rust_changed == 'true' name: Rust Client needs: generate_clients - uses: ./.github/workflows/build-sdk.yml + uses: ./.github/workflows/build-rust-client.yml secrets: inherit - test_sdk: + test_rust_client: if: needs.generate_clients.outputs.rust_changed == 'true' name: Rust Client needs: generate_clients - uses: ./.github/workflows/test-sdk.yml + uses: ./.github/workflows/test-rust-client.yml secrets: inherit diff --git a/.github/workflows/test-js.yml b/.github/workflows/test-js-client.yml similarity index 100% rename from .github/workflows/test-js.yml rename to .github/workflows/test-js-client.yml diff --git a/.github/workflows/test-sdk.yml b/.github/workflows/test-rust-client.yml similarity index 97% rename from .github/workflows/test-sdk.yml rename to .github/workflows/test-rust-client.yml index 7462f399..fdb8b1fb 100644 --- a/.github/workflows/test-sdk.yml +++ b/.github/workflows/test-rust-client.yml @@ -1,4 +1,4 @@ -name: Test Programs +name: Test Rust Client on: workflow_call: From 902caa9f02521f29109010836b4f64efe95db83c Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 24 Aug 2023 00:27:46 +0300 Subject: [PATCH 25/31] Refactor clients CI --- .github/file-filters.yml | 6 +- .github/workflows/build-rust-client.yml | 12 ++- .github/workflows/create-proposal.yml | 36 +++----- .../{deploy-js.yml => deploy-js-client.yml} | 0 .github/workflows/deploy-rust-client.yml | 92 +++++++++++++++++++ .github/workflows/test-rust-client.yml | 4 +- ...{publish-crate.yml => version-program.yml} | 73 ++++++--------- configs/client-scripts/test-js-client.sh | 16 ++++ .../test-rust-client.sh} | 10 +- package.json | 3 +- 10 files changed, 170 insertions(+), 82 deletions(-) rename .github/workflows/{deploy-js.yml => deploy-js-client.yml} (100%) create mode 100644 .github/workflows/deploy-rust-client.yml rename .github/workflows/{publish-crate.yml => version-program.yml} (65%) create mode 100755 configs/client-scripts/test-js-client.sh rename configs/{program-scripts/sdk.sh => client-scripts/test-rust-client.sh} (60%) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 7fb245b7..f04ab179 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -23,9 +23,9 @@ programs: &programs client_common: &client_common - *programs - - ".github/workflows/test-js.yml" - - ".github/workflows/test-sdk.yml" - - ".github/workflows/build-sdk.yml" + - ".github/workflows/test-js-client.yml" + - ".github/workflows/test-rust-client.yml" + - ".github/workflows/build-rust-client.yml" - ".github/workflows/main.yml" - ".github/file-filters.yml" - ".github/.env" diff --git a/.github/workflows/build-rust-client.yml b/.github/workflows/build-rust-client.yml index 616ca981..26867f5d 100644 --- a/.github/workflows/build-rust-client.yml +++ b/.github/workflows/build-rust-client.yml @@ -51,7 +51,15 @@ jobs: command: clippy args: --all-targets --all-features --no-deps --manifest-path ./clients/rust/Cargo.toml - - name: Build SDK + - name: Build Rust client shell: bash working-directory: clients/rust - run: cargo build + run: cargo build --release + + - name: Upload Rust client builds + uses: actions/upload-artifact@v3 + with: + name: rust-client-builds + # First wildcard ensures exported paths are consistently under the clients folder. + path: ./client*/rust/target/release/*mpl_token_metadata* + if-no-files-found: error diff --git a/.github/workflows/create-proposal.yml b/.github/workflows/create-proposal.yml index e259aa9e..52692828 100644 --- a/.github/workflows/create-proposal.yml +++ b/.github/workflows/create-proposal.yml @@ -101,33 +101,21 @@ jobs: - name: Determine program version run: | IDL_NAME=`echo "${{ inputs.program }}" | tr - _` - VERSION=`jq '.version' ./idls/mpl_${IDL_NAME}.json | sed 's/"//g'` + VERSION=`jq '.version' ./idls/${IDL_NAME}.json | sed 's/"//g'` MAJOR=`echo ${VERSION} | cut -d. -f1` MINOR=`echo ${VERSION} | cut -d. -f2` - PATCH=`echo ${VERSION} | cut -d. -f3-4` - - case "$PATCH" in - *"beta"*) - PRERELEASE=`echo ${PATCH} | cut -d. -f2` - PATCH=`echo ${PATCH} | cut -d- -f1` - ;; - *) - PRERELEASE=0 - ;; - esac - - if [ $PRERELEASE -eq 0 ]; then - if [ "${{ inputs.bump }}" == "major" ]; then - MAJOR=$((MAJOR + 1)) - MINOR=0 - PATCH=0 - elif [ "${{ inputs.bump }}" == "minor" ]; then - MINOR=$((MINOR + 1)) - PATCH=0 - else - PATCH=$((PATCH + 1)) - fi + PATCH=`echo ${VERSION} | cut -d. -f3` + + if [ "${{ inputs.bump }}" == "major" ]; then + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + elif [ "${{ inputs.bump }}" == "minor" ]; then + MINOR=$((MINOR + 1)) + PATCH=0 + else + PATCH=$((PATCH + 1)) fi echo PROGRAM_VERSION="${MAJOR}.${MINOR}.${PATCH}" >> $GITHUB_ENV diff --git a/.github/workflows/deploy-js.yml b/.github/workflows/deploy-js-client.yml similarity index 100% rename from .github/workflows/deploy-js.yml rename to .github/workflows/deploy-js-client.yml diff --git a/.github/workflows/deploy-rust-client.yml b/.github/workflows/deploy-rust-client.yml new file mode 100644 index 00000000..f2aa011a --- /dev/null +++ b/.github/workflows/deploy-rust-client.yml @@ -0,0 +1,92 @@ +name: Deploy Rust Client + +on: + workflow_dispatch: + inputs: + level: + description: Level + required: true + default: patch + type: choice + options: + - patch + - minor + - major + - rc + - beta + - alpha + - release + - version + version: + description: Version + required: false + type: string + dry_run: + description: Dry run + required: true + default: true + type: boolean + +env: + CACHE: true + +jobs: + build_rust_client: + name: Rust Client + uses: ./.github/workflows/build-rust-client.yml + secrets: inherit + + test_rust_client: + name: Rust Client + needs: build_rust_client + uses: ./.github/workflows/test-rust-client.yml + secrets: inherit + + publish_crate: + name: Rust Client / Publish Crate + runs-on: ubuntu-latest + needs: test_rust_client + permissions: + contents: write + steps: + - name: Git checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.SVC_TOKEN }} + + - name: Load environment variables + run: cat .github/.env >> $GITHUB_ENV + + - name: Install Rust + uses: metaplex-foundation/actions/install-rust@v1 + with: + toolchain: ${{ env.RUST_VERSION }} + + - name: Install Solana + uses: metaplex-foundation/actions/install-solana@v1 + with: + version: ${{ env.SOLANA_VERSION }} + cache: ${{ env.CACHE }} + + - name: Install cargo-release + uses: metaplex-foundation/actions/install-cargo-release@v1 + with: + cache: ${{ env.CACHE }} + + - name: Publish Crate + working-directory: ./clients/rust + run: | + if [ "${{ inputs.level }}" == "version" ]; then + BUMP=${{ inputs.version }} + else + BUMP=${{ inputs.level }} + fi + + if [ "${{ inputs.dry_run }}" == "false" ]; then + OPTIONS="--no-confirm --execute" + fi + + if [ "${{ inputs.level }}" == "version" ]; then + + cargo login ${{ secrets.CRATES_TOKEN }} + cargo release $BUMP $OPTIONS diff --git a/.github/workflows/test-rust-client.yml b/.github/workflows/test-rust-client.yml index fdb8b1fb..fc5b4f35 100644 --- a/.github/workflows/test-rust-client.yml +++ b/.github/workflows/test-rust-client.yml @@ -38,5 +38,5 @@ jobs: - name: Run tests shell: bash - working-directory: configs/program-scripts - run: RUST_LOG=error ./sdk.sh + working-directory: configs/client-scripts + run: RUST_LOG=error ./test-rust-client.sh diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/version-program.yml similarity index 65% rename from .github/workflows/publish-crate.yml rename to .github/workflows/version-program.yml index 0b433c64..7f18f5fd 100644 --- a/.github/workflows/publish-crate.yml +++ b/.github/workflows/version-program.yml @@ -1,4 +1,4 @@ -name: Publish Crate +name: Version Program on: workflow_dispatch: @@ -10,11 +10,6 @@ on: type: choice options: - token-metadata - pre_release: - description: Pre-release (beta) - required: true - type: boolean - default: false bump: description: Version bump required: true @@ -42,16 +37,22 @@ jobs: with: program_matrix: '["${{ inputs.program }}"]' - test_js: + test_js_client: name: JS client needs: test_programs - uses: ./.github/workflows/test-js.yml + uses: ./.github/workflows/test-js-client.yml + secrets: inherit + + test_rust_client: + name: Rust client + needs: test_programs + uses: ./.github/workflows/test-rust-client.yml secrets: inherit - publish_crate: - name: Program / Publish Crate + version_program: + name: Program / Version runs-on: ubuntu-latest - needs: test_js + needs: [test_js_client, test_rust_client] permissions: contents: write steps: @@ -81,43 +82,25 @@ jobs: - name: Bump Program Version run: | - IDL_NAME="mpl_`echo "${{ inputs.program }}" | tr - _`" + IDL_NAME="`echo "${{ inputs.program }}" | tr - _`" VERSION=`jq '.version' ./idls/${IDL_NAME}.json | sed 's/"//g'` MAJOR=`echo ${VERSION} | cut -d. -f1` MINOR=`echo ${VERSION} | cut -d. -f2` - PATCH=`echo ${VERSION} | cut -d. -f3-4` - - case "$PATCH" in - *"beta"*) - PRERELEASE=`echo ${PATCH} | cut -d. -f2` - PATCH=`echo ${PATCH} | cut -d- -f1` - ;; - *) - PRERELEASE=0 - ;; - esac - - if [ $PRERELEASE -eq 0 ]; then - if [ "${{ inputs.bump }}" == "major" ]; then - MAJOR=$((MAJOR + 1)) - MINOR=0 - PATCH=0 - elif [ "${{ inputs.bump }}" == "minor" ]; then - MINOR=$((MINOR + 1)) - PATCH=0 - else - PATCH=$((PATCH + 1)) - fi - fi - - if [ "${{ inputs.pre_release }}" == "true" ]; then - PRERELEASE="-beta.$((PRERELEASE + 1))" + PATCH=`echo ${VERSION} | cut -d. -f3` + + if [ "${{ inputs.bump }}" == "major" ]; then + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + elif [ "${{ inputs.bump }}" == "minor" ]; then + MINOR=$((MINOR + 1)) + PATCH=0 else - PRERELEASE="" + PATCH=$((PATCH + 1)) fi - PROGRAM_VERSION="${MAJOR}.${MINOR}.${PATCH}${PRERELEASE}" + PROGRAM_VERSION="${MAJOR}.${MINOR}.${PATCH}" cp ./idls/${IDL_NAME}.json ./idls/${IDL_NAME}-previous.json jq ".version = \"${PROGRAM_VERSION}\"" ./idls/${IDL_NAME}-previous.json > ./idls/${IDL_NAME}.json @@ -130,7 +113,7 @@ jobs: with: name: program-builds - - name: Publish Crate + - name: Version Program working-directory: ./programs/${{ inputs.program }}/program run: | git stash @@ -138,7 +121,7 @@ jobs: git config user.email "${{ env.COMMIT_USER_EMAIL }}" cargo login ${{ secrets.CRATES_TOKEN }} - cargo release ${{ env.PROGRAM_VERSION }} --no-confirm --no-push --no-tag --execute + cargo release ${{ env.PROGRAM_VERSION }} --no-confirm --no-push --no-tag --no-publish --execute git reset --soft HEAD~1 git stash pop @@ -146,5 +129,5 @@ jobs: - name: Commit and tag new version uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: Publish mpl-${{ inputs.program }} crate v${{ env.PROGRAM_VERSION }} - tagging_message: mpl-${{ inputs.program }}@v${{ env.PROGRAM_VERSION }} + commit_message: "chore: ${{ inputs.program }} version ${{ env.PROGRAM_VERSION }}" + tagging_message: ${{ inputs.program }}@v${{ env.PROGRAM_VERSION }} \ No newline at end of file diff --git a/configs/client-scripts/test-js-client.sh b/configs/client-scripts/test-js-client.sh new file mode 100755 index 00000000..5493aa01 --- /dev/null +++ b/configs/client-scripts/test-js-client.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +# go to parent folder +cd $(dirname $(dirname $SCRIPT_DIR)) +WORKING_DIR=$(pwd) + +# command-line input +ARGS=$* + +# js client tests folder +cd ${WORKING_DIR}/clients/js + +for t in `ls test/${ARGS}*`; do + pnpm build && pnpm test ${t} +done diff --git a/configs/program-scripts/sdk.sh b/configs/client-scripts/test-rust-client.sh similarity index 60% rename from configs/program-scripts/sdk.sh rename to configs/client-scripts/test-rust-client.sh index 01ee63fd..2a550424 100755 --- a/configs/program-scripts/sdk.sh +++ b/configs/client-scripts/test-rust-client.sh @@ -1,22 +1,22 @@ #!/bin/bash SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) -OUTPUT="./programs/.bin" +PROGRAMS_OUTPUT="./programs/.bin" # go to parent folder cd $(dirname $(dirname $SCRIPT_DIR)) -# default to input from the command-line +# command-line input ARGS=$* WORKING_DIR=$(pwd) SOLFMT="solfmt" -export SBF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" +export SBF_OUT_DIR="${WORKING_DIR}/${PROGRAMS_OUTPUT}" # client SDK tests cd ${WORKING_DIR}/clients/rust if [ ! "$(command -v $SOLFMT)" = "" ]; then - CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} + CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${PROGRAMS_OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} else - cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} + cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${PROGRAMS_OUTPUT} ${ARGS} fi diff --git a/package.json b/package.json index e36b330b..82938a00 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "programs:test": "RUST_LOG=error ./configs/program-scripts/test.sh", "programs:debug": "./configs/program-scripts/test.sh", "programs:clean": "rm -rf ./programs/.bin", - "programs:sdk": "./configs/program-scripts/sdk.sh", + "clients:rust:test": "./configs/client-scripts/test-rust-client.sh", + "clients:js:test": "./configs/client-scripts/test-js-client.sh", "generate": "pnpm generate:idls && pnpm generate:clients", "generate:idls": "node ./configs/shank.cjs", "generate:clients": "node ./configs/kinobi.cjs", From 312dcb74d3b43429902e0237d7a65edec4bd7758 Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 24 Aug 2023 01:00:47 +0300 Subject: [PATCH 26/31] Updata shank version --- .../approveCollectionAuthority.ts | 8 +- .../instructions/approveUseAuthority.ts | 8 +- .../bubblegumSetCollectionSize.ts | 15 +- .../js/src/generated/instructions/burnNft.ts | 10 +- .../instructions/createEscrowAccount.ts | 10 +- .../instructions/createMasterEditionV3.ts | 8 +- .../instructions/createMetadataAccountV3.ts | 8 +- ...ditionFromMasterEditionViaPrintingToken.ts | 10 +- ...mintNewEditionFromMasterEditionViaToken.ts | 8 +- ...ewEditionFromMasterEditionViaVaultProxy.ts | 8 +- .../instructions/revokeUseAuthority.ts | 8 +- .../instructions/setAndVerifyCollection.ts | 13 +- .../setAndVerifySizedCollectionItem.ts | 13 +- .../instructions/setCollectionSize.ts | 15 +- .../instructions/setTokenStandard.ts | 10 +- .../instructions/transferOutOfEscrow.ts | 10 +- .../instructions/unverifyCollection.ts | 15 +- .../unverifySizedCollectionItem.ts | 13 +- .../js/src/generated/instructions/utilize.ts | 20 +- .../instructions/verifyCollection.ts | 13 +- .../instructions/verifySizedCollectionItem.ts | 13 +- .../approve_collection_authority.rs | 10 - .../instructions/approve_use_authority.rs | 10 - .../bubblegum_set_collection_size.rs | 10 - .../src/generated/instructions/burn_nft.rs | 10 - .../instructions/create_escrow_account.rs | 10 - .../instructions/create_master_edition_v3.rs | 10 - .../create_metadata_account_v3.rs | 10 - ..._from_master_edition_via_printing_token.rs | 10 - ...w_edition_from_master_edition_via_token.rs | 10 - ...ion_from_master_edition_via_vault_proxy.rs | 10 - .../instructions/revoke_use_authority.rs | 10 - .../instructions/set_and_verify_collection.rs | 10 - .../set_and_verify_sized_collection_item.rs | 10 - .../instructions/set_collection_size.rs | 10 - .../instructions/set_token_standard.rs | 10 - .../instructions/transfer_out_of_escrow.rs | 10 - .../instructions/unverify_collection.rs | 10 - .../unverify_sized_collection_item.rs | 10 - .../src/generated/instructions/utilize.rs | 20 - .../instructions/verify_collection.rs | 10 - .../verify_sized_collection_item.rs | 10 - idls/token_metadata.json | 2138 ++++++++++++----- programs/token-metadata/Cargo.lock | 52 +- programs/token-metadata/program/Cargo.toml | 2 +- .../program/src/instruction/mod.rs | 36 +- 46 files changed, 1696 insertions(+), 988 deletions(-) diff --git a/clients/js/src/generated/instructions/approveCollectionAuthority.ts b/clients/js/src/generated/instructions/approveCollectionAuthority.ts index f3c5d5d4..2ab78cae 100644 --- a/clients/js/src/generated/instructions/approveCollectionAuthority.ts +++ b/clients/js/src/generated/instructions/approveCollectionAuthority.ts @@ -104,6 +104,7 @@ export function approveCollectionAuthority( collectionAuthorityRecord: [input.collectionAuthorityRecord, true] as const, newCollectionAuthority: [input.newCollectionAuthority, false] as const, mint: [input.mint, false] as const, + rent: [input.rent, false] as const, }; addObjectProperty( resolvedAccounts, @@ -142,11 +143,6 @@ export function approveCollectionAuthority( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); addAccountMeta( keys, @@ -160,7 +156,7 @@ export function approveCollectionAuthority( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.mint, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/approveUseAuthority.ts b/clients/js/src/generated/instructions/approveUseAuthority.ts index 86befd50..c6d55311 100644 --- a/clients/js/src/generated/instructions/approveUseAuthority.ts +++ b/clients/js/src/generated/instructions/approveUseAuthority.ts @@ -125,6 +125,7 @@ export function approveUseAuthority( ownerTokenAccount: [input.ownerTokenAccount, true] as const, mint: [input.mint, false] as const, burner: [input.burner, false] as const, + rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -170,11 +171,6 @@ export function approveUseAuthority( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, false); @@ -187,7 +183,7 @@ export function approveUseAuthority( addAccountMeta(keys, signers, resolvedAccounts.burner, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts index 07cbc52e..0288df50 100644 --- a/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts +++ b/clients/js/src/generated/instructions/bubblegumSetCollectionSize.ts @@ -21,7 +21,7 @@ import { struct, u8, } from '@metaplex-foundation/umi/serializers'; -import { addAccountMeta, addObjectProperty } from '../shared'; +import { addAccountMeta } from '../shared'; import { SetCollectionSizeArgs, SetCollectionSizeArgsArgs, @@ -113,15 +113,12 @@ export function bubblegumSetCollectionSize( collectionAuthority: [input.collectionAuthority, true] as const, collectionMint: [input.collectionMint, false] as const, bubblegumSigner: [input.bubblegumSigner, false] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; const resolvingArgs = {}; - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, false); @@ -132,7 +129,7 @@ export function bubblegumSetCollectionSize( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/burnNft.ts b/clients/js/src/generated/instructions/burnNft.ts index de731796..ff74bfab 100644 --- a/clients/js/src/generated/instructions/burnNft.ts +++ b/clients/js/src/generated/instructions/burnNft.ts @@ -87,6 +87,7 @@ export function burnNft( mint: [input.mint, true] as const, tokenAccount: [input.tokenAccount, true] as const, masterEditionAccount: [input.masterEditionAccount, true] as const, + collectionMetadata: [input.collectionMetadata, true] as const, }; addObjectProperty( resolvedAccounts, @@ -111,13 +112,6 @@ export function burnNft( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'collectionMetadata', - input.collectionMetadata - ? ([input.collectionMetadata, true] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.owner, false); @@ -125,7 +119,7 @@ export function burnNft( addAccountMeta(keys, signers, resolvedAccounts.tokenAccount, false); addAccountMeta(keys, signers, resolvedAccounts.masterEditionAccount, false); addAccountMeta(keys, signers, resolvedAccounts.splTokenProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, false); + addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, true); // Data. const data = getBurnNftInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/createEscrowAccount.ts b/clients/js/src/generated/instructions/createEscrowAccount.ts index c5246aa5..f17d7d4f 100644 --- a/clients/js/src/generated/instructions/createEscrowAccount.ts +++ b/clients/js/src/generated/instructions/createEscrowAccount.ts @@ -103,6 +103,7 @@ export function createEscrowAccount( escrow: [input.escrow, true] as const, mint: [input.mint, false] as const, tokenAccount: [input.tokenAccount, false] as const, + authority: [input.authority, false] as const, }; addObjectProperty( resolvedAccounts, @@ -154,13 +155,6 @@ export function createEscrowAccount( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'authority', - input.authority - ? ([input.authority, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.escrow, false); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); @@ -170,7 +164,7 @@ export function createEscrowAccount( addAccountMeta(keys, signers, resolvedAccounts.payer, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); addAccountMeta(keys, signers, resolvedAccounts.sysvarInstructions, false); - addAccountMeta(keys, signers, resolvedAccounts.authority, false); + addAccountMeta(keys, signers, resolvedAccounts.authority, true); // Data. const data = getCreateEscrowAccountInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/createMasterEditionV3.ts b/clients/js/src/generated/instructions/createMasterEditionV3.ts index 154023ea..303dfd31 100644 --- a/clients/js/src/generated/instructions/createMasterEditionV3.ts +++ b/clients/js/src/generated/instructions/createMasterEditionV3.ts @@ -120,6 +120,7 @@ export function createMasterEditionV3( const resolvedAccounts = { mint: [input.mint, true] as const, mintAuthority: [input.mintAuthority, false] as const, + rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -182,11 +183,6 @@ export function createMasterEditionV3( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.edition, false); @@ -197,7 +193,7 @@ export function createMasterEditionV3( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/createMetadataAccountV3.ts b/clients/js/src/generated/instructions/createMetadataAccountV3.ts index 8f4e2198..f984fae8 100644 --- a/clients/js/src/generated/instructions/createMetadataAccountV3.ts +++ b/clients/js/src/generated/instructions/createMetadataAccountV3.ts @@ -130,6 +130,7 @@ export function createMetadataAccountV3( const resolvedAccounts = { mint: [input.mint, false] as const, mintAuthority: [input.mintAuthority, false] as const, + rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -169,11 +170,6 @@ export function createMetadataAccountV3( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.metadata, false); @@ -182,7 +178,7 @@ export function createMetadataAccountV3( addAccountMeta(keys, signers, resolvedAccounts.payer, false); addAccountMeta(keys, signers, resolvedAccounts.updateAuthority, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts index 3204d5af..1e116e7e 100644 --- a/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts +++ b/clients/js/src/generated/instructions/deprecatedMintNewEditionFromMasterEditionViaPrintingToken.ts @@ -128,6 +128,7 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( burnAuthority: [input.burnAuthority, false] as const, masterUpdateAuthority: [input.masterUpdateAuthority, false] as const, masterMetadata: [input.masterMetadata, false] as const, + reservationList: [input.reservationList, true] as const, }; addObjectProperty( resolvedAccounts, @@ -212,13 +213,6 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'reservationList', - input.reservationList - ? ([input.reservationList, true] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.edition, false); @@ -235,7 +229,7 @@ export function deprecatedMintNewEditionFromMasterEditionViaPrintingToken( addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); addAccountMeta(keys, signers, resolvedAccounts.rent, false); - addAccountMeta(keys, signers, resolvedAccounts.reservationList, false); + addAccountMeta(keys, signers, resolvedAccounts.reservationList, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts index 1f1cf719..c7b0a481 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaToken.ts @@ -143,6 +143,7 @@ export function mintNewEditionFromMasterEditionViaToken( false, ] as const, metadata: [input.metadata, false] as const, + rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -178,11 +179,6 @@ export function mintNewEditionFromMasterEditionViaToken( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.newMetadata, false); @@ -203,7 +199,7 @@ export function mintNewEditionFromMasterEditionViaToken( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts index 37ddf9b4..6151c328 100644 --- a/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts +++ b/clients/js/src/generated/instructions/mintNewEditionFromMasterEditionViaVaultProxy.ts @@ -155,6 +155,7 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( ] as const, metadata: [input.metadata, false] as const, tokenVaultProgram: [input.tokenVaultProgram, false] as const, + rent: [input.rent, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -190,11 +191,6 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.newMetadata, false); @@ -218,7 +214,7 @@ export function mintNewEditionFromMasterEditionViaVaultProxy( addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.tokenVaultProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/revokeUseAuthority.ts b/clients/js/src/generated/instructions/revokeUseAuthority.ts index 01d44a8d..ac38e34e 100644 --- a/clients/js/src/generated/instructions/revokeUseAuthority.ts +++ b/clients/js/src/generated/instructions/revokeUseAuthority.ts @@ -105,6 +105,7 @@ export function revokeUseAuthority( user: [input.user, false] as const, ownerTokenAccount: [input.ownerTokenAccount, true] as const, mint: [input.mint, false] as const, + rent: [input.rent, false] as const, }; addObjectProperty( resolvedAccounts, @@ -142,11 +143,6 @@ export function revokeUseAuthority( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'rent', - input.rent ? ([input.rent, false] as const) : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, false); addAccountMeta(keys, signers, resolvedAccounts.owner, false); @@ -156,7 +152,7 @@ export function revokeUseAuthority( addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); - addAccountMeta(keys, signers, resolvedAccounts.rent, false); + addAccountMeta(keys, signers, resolvedAccounts.rent, true); // Data. const data = getRevokeUseAuthorityInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/setAndVerifyCollection.ts b/clients/js/src/generated/instructions/setAndVerifyCollection.ts index c88c2cdc..f831e711 100644 --- a/clients/js/src/generated/instructions/setAndVerifyCollection.ts +++ b/clients/js/src/generated/instructions/setAndVerifyCollection.ts @@ -104,6 +104,10 @@ export function setAndVerifyCollection( input.collectionMasterEditionAccount, false, ] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; addObjectProperty( resolvedAccounts, @@ -119,13 +123,6 @@ export function setAndVerifyCollection( ? ([input.updateAuthority, false] as const) : ([context.identity.publicKey, false] as const) ); - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -143,7 +140,7 @@ export function setAndVerifyCollection( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts index 97e21082..d29d8711 100644 --- a/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/setAndVerifySizedCollectionItem.ts @@ -107,6 +107,10 @@ export function setAndVerifySizedCollectionItem( input.collectionMasterEditionAccount, true, ] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; addObjectProperty( resolvedAccounts, @@ -122,13 +126,6 @@ export function setAndVerifySizedCollectionItem( ? ([input.updateAuthority, false] as const) : ([context.identity.publicKey, false] as const) ); - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -146,7 +143,7 @@ export function setAndVerifySizedCollectionItem( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/setCollectionSize.ts b/clients/js/src/generated/instructions/setCollectionSize.ts index d14de9b7..91dd922b 100644 --- a/clients/js/src/generated/instructions/setCollectionSize.ts +++ b/clients/js/src/generated/instructions/setCollectionSize.ts @@ -21,7 +21,7 @@ import { struct, u8, } from '@metaplex-foundation/umi/serializers'; -import { addAccountMeta, addObjectProperty } from '../shared'; +import { addAccountMeta } from '../shared'; import { SetCollectionSizeArgs, SetCollectionSizeArgsArgs, @@ -109,15 +109,12 @@ export function setCollectionSize( collectionMetadata: [input.collectionMetadata, true] as const, collectionAuthority: [input.collectionAuthority, true] as const, collectionMint: [input.collectionMint, false] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; const resolvingArgs = {}; - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.collectionMetadata, false); @@ -127,7 +124,7 @@ export function setCollectionSize( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/setTokenStandard.ts b/clients/js/src/generated/instructions/setTokenStandard.ts index cd5952dd..090b1385 100644 --- a/clients/js/src/generated/instructions/setTokenStandard.ts +++ b/clients/js/src/generated/instructions/setTokenStandard.ts @@ -91,6 +91,7 @@ export function setTokenStandard( // Resolved inputs. const resolvedAccounts = { mint: [input.mint, false] as const, + edition: [input.edition, false] as const, }; addObjectProperty( resolvedAccounts, @@ -109,18 +110,11 @@ export function setTokenStandard( ? ([input.updateAuthority, false] as const) : ([context.identity, false] as const) ); - addObjectProperty( - resolvedAccounts, - 'edition', - input.edition - ? ([input.edition, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.updateAuthority, false); addAccountMeta(keys, signers, resolvedAccounts.mint, false); - addAccountMeta(keys, signers, resolvedAccounts.edition, false); + addAccountMeta(keys, signers, resolvedAccounts.edition, true); // Data. const data = getSetTokenStandardInstructionDataSerializer().serialize({}); diff --git a/clients/js/src/generated/instructions/transferOutOfEscrow.ts b/clients/js/src/generated/instructions/transferOutOfEscrow.ts index 81fe6817..c8933412 100644 --- a/clients/js/src/generated/instructions/transferOutOfEscrow.ts +++ b/clients/js/src/generated/instructions/transferOutOfEscrow.ts @@ -129,6 +129,7 @@ export function transferOutOfEscrow( attributeDst: [input.attributeDst, true] as const, escrowMint: [input.escrowMint, false] as const, escrowAccount: [input.escrowAccount, false] as const, + authority: [input.authority, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -187,13 +188,6 @@ export function transferOutOfEscrow( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'authority', - input.authority - ? ([input.authority, false] as const) - : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.escrow, false); @@ -208,7 +202,7 @@ export function transferOutOfEscrow( addAccountMeta(keys, signers, resolvedAccounts.ataProgram, false); addAccountMeta(keys, signers, resolvedAccounts.tokenProgram, false); addAccountMeta(keys, signers, resolvedAccounts.sysvarInstructions, false); - addAccountMeta(keys, signers, resolvedAccounts.authority, false); + addAccountMeta(keys, signers, resolvedAccounts.authority, true); // Data. const data = diff --git a/clients/js/src/generated/instructions/unverifyCollection.ts b/clients/js/src/generated/instructions/unverifyCollection.ts index 64cff44e..0ade7b9d 100644 --- a/clients/js/src/generated/instructions/unverifyCollection.ts +++ b/clients/js/src/generated/instructions/unverifyCollection.ts @@ -21,7 +21,7 @@ import { struct, u8, } from '@metaplex-foundation/umi/serializers'; -import { addAccountMeta, addObjectProperty } from '../shared'; +import { addAccountMeta } from '../shared'; // Accounts. export type UnverifyCollectionInstructionAccounts = { @@ -100,14 +100,11 @@ export function unverifyCollection( input.collectionMasterEditionAccount, false, ] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -123,7 +120,7 @@ export function unverifyCollection( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts index 17501bb7..571e4839 100644 --- a/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/unverifySizedCollectionItem.ts @@ -105,6 +105,10 @@ export function unverifySizedCollectionItem( input.collectionMasterEditionAccount, false, ] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; addObjectProperty( resolvedAccounts, @@ -113,13 +117,6 @@ export function unverifySizedCollectionItem( ? ([input.payer, true] as const) : ([context.payer, true] as const) ); - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -136,7 +133,7 @@ export function unverifySizedCollectionItem( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/utilize.ts b/clients/js/src/generated/instructions/utilize.ts index d860e579..30fb6f0b 100644 --- a/clients/js/src/generated/instructions/utilize.ts +++ b/clients/js/src/generated/instructions/utilize.ts @@ -106,6 +106,8 @@ export function utilize( mint: [input.mint, true] as const, useAuthority: [input.useAuthority, true] as const, owner: [input.owner, false] as const, + useAuthorityRecord: [input.useAuthorityRecord, true] as const, + burner: [input.burner, false] as const, }; const resolvingArgs = {}; addObjectProperty( @@ -167,20 +169,6 @@ export function utilize( false, ] as const) ); - addObjectProperty( - resolvedAccounts, - 'useAuthorityRecord', - input.useAuthorityRecord - ? ([input.useAuthorityRecord, true] as const) - : ([programId, false] as const) - ); - addObjectProperty( - resolvedAccounts, - 'burner', - input.burner - ? ([input.burner, false] as const) - : ([programId, false] as const) - ); const resolvedArgs = { ...input, ...resolvingArgs }; addAccountMeta(keys, signers, resolvedAccounts.metadata, false); @@ -192,8 +180,8 @@ export function utilize( addAccountMeta(keys, signers, resolvedAccounts.ataProgram, false); addAccountMeta(keys, signers, resolvedAccounts.systemProgram, false); addAccountMeta(keys, signers, resolvedAccounts.rent, false); - addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, false); - addAccountMeta(keys, signers, resolvedAccounts.burner, false); + addAccountMeta(keys, signers, resolvedAccounts.useAuthorityRecord, true); + addAccountMeta(keys, signers, resolvedAccounts.burner, true); // Data. const data = getUtilizeInstructionDataSerializer().serialize(resolvedArgs); diff --git a/clients/js/src/generated/instructions/verifyCollection.ts b/clients/js/src/generated/instructions/verifyCollection.ts index eb522b93..4abb001a 100644 --- a/clients/js/src/generated/instructions/verifyCollection.ts +++ b/clients/js/src/generated/instructions/verifyCollection.ts @@ -102,6 +102,10 @@ export function verifyCollection( input.collectionMasterEditionAccount, false, ] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; addObjectProperty( resolvedAccounts, @@ -110,13 +114,6 @@ export function verifyCollection( ? ([input.payer, true] as const) : ([context.payer, true] as const) ); - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -133,7 +130,7 @@ export function verifyCollection( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts index f1248441..9a62eb6a 100644 --- a/clients/js/src/generated/instructions/verifySizedCollectionItem.ts +++ b/clients/js/src/generated/instructions/verifySizedCollectionItem.ts @@ -105,6 +105,10 @@ export function verifySizedCollectionItem( input.collectionMasterEditionAccount, false, ] as const, + collectionAuthorityRecord: [ + input.collectionAuthorityRecord, + false, + ] as const, }; addObjectProperty( resolvedAccounts, @@ -113,13 +117,6 @@ export function verifySizedCollectionItem( ? ([input.payer, true] as const) : ([context.payer, true] as const) ); - addObjectProperty( - resolvedAccounts, - 'collectionAuthorityRecord', - input.collectionAuthorityRecord - ? ([input.collectionAuthorityRecord, false] as const) - : ([programId, false] as const) - ); addAccountMeta(keys, signers, resolvedAccounts.metadata, false); addAccountMeta(keys, signers, resolvedAccounts.collectionAuthority, false); @@ -136,7 +133,7 @@ export function verifySizedCollectionItem( keys, signers, resolvedAccounts.collectionAuthorityRecord, - false + true ); // Data. diff --git a/clients/rust/src/generated/instructions/approve_collection_authority.rs b/clients/rust/src/generated/instructions/approve_collection_authority.rs index 7711317c..2d28d78c 100644 --- a/clients/rust/src/generated/instructions/approve_collection_authority.rs +++ b/clients/rust/src/generated/instructions/approve_collection_authority.rs @@ -62,11 +62,6 @@ impl ApproveCollectionAuthority { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = ApproveCollectionAuthorityInstructionData::new() .try_to_vec() @@ -254,11 +249,6 @@ impl<'a> ApproveCollectionAuthorityCpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = ApproveCollectionAuthorityInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/approve_use_authority.rs b/clients/rust/src/generated/instructions/approve_use_authority.rs index a8e97fac..371504c8 100644 --- a/clients/rust/src/generated/instructions/approve_use_authority.rs +++ b/clients/rust/src/generated/instructions/approve_use_authority.rs @@ -81,11 +81,6 @@ impl ApproveUseAuthority { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = ApproveUseAuthorityInstructionData::new() .try_to_vec() @@ -335,11 +330,6 @@ impl<'a> ApproveUseAuthorityCpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = ApproveUseAuthorityInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs index 01dfc23f..135df73d 100644 --- a/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs +++ b/clients/rust/src/generated/instructions/bubblegum_set_collection_size.rs @@ -51,11 +51,6 @@ impl BubblegumSetCollectionSize { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = BubblegumSetCollectionSizeInstructionData::new() .try_to_vec() @@ -230,11 +225,6 @@ impl<'a> BubblegumSetCollectionSizeCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = BubblegumSetCollectionSizeInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/burn_nft.rs b/clients/rust/src/generated/instructions/burn_nft.rs index b44c91b5..3aeea0e6 100644 --- a/clients/rust/src/generated/instructions/burn_nft.rs +++ b/clients/rust/src/generated/instructions/burn_nft.rs @@ -57,11 +57,6 @@ impl BurnNft { collection_metadata, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = BurnNftInstructionData::new().try_to_vec().unwrap(); @@ -232,11 +227,6 @@ impl<'a> BurnNftCpi<'a> { *collection_metadata.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = BurnNftInstructionData::new().try_to_vec().unwrap(); diff --git a/clients/rust/src/generated/instructions/create_escrow_account.rs b/clients/rust/src/generated/instructions/create_escrow_account.rs index c31279c7..f72d4542 100644 --- a/clients/rust/src/generated/instructions/create_escrow_account.rs +++ b/clients/rust/src/generated/instructions/create_escrow_account.rs @@ -68,11 +68,6 @@ impl CreateEscrowAccount { accounts.push(solana_program::instruction::AccountMeta::new_readonly( authority, true, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = CreateEscrowAccountInstructionData::new() .try_to_vec() @@ -267,11 +262,6 @@ impl<'a> CreateEscrowAccountCpi<'a> { *authority.key, true, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = CreateEscrowAccountInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/create_master_edition_v3.rs b/clients/rust/src/generated/instructions/create_master_edition_v3.rs index 404b04b6..b7345e68 100644 --- a/clients/rust/src/generated/instructions/create_master_edition_v3.rs +++ b/clients/rust/src/generated/instructions/create_master_edition_v3.rs @@ -71,11 +71,6 @@ impl CreateMasterEditionV3 { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = CreateMasterEditionV3InstructionData::new() .try_to_vec() @@ -288,11 +283,6 @@ impl<'a> CreateMasterEditionV3Cpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = CreateMasterEditionV3InstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs index 30be5462..f1e536e8 100644 --- a/clients/rust/src/generated/instructions/create_metadata_account_v3.rs +++ b/clients/rust/src/generated/instructions/create_metadata_account_v3.rs @@ -61,11 +61,6 @@ impl CreateMetadataAccountV3 { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = CreateMetadataAccountV3InstructionData::new() .try_to_vec() @@ -264,11 +259,6 @@ impl<'a> CreateMetadataAccountV3Cpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = CreateMetadataAccountV3InstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs index 9dd29f8d..1b6e642d 100644 --- a/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs +++ b/clients/rust/src/generated/instructions/deprecated_mint_new_edition_from_master_edition_via_printing_token.rs @@ -110,11 +110,6 @@ impl DeprecatedMintNewEditionFromMasterEditionViaPrintingToken { reservation_list, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionData::new() .try_to_vec() @@ -422,11 +417,6 @@ impl<'a> DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenCpi<'a> { *reservation_list.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs index 1677cf2e..af742b10 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_token.rs @@ -103,11 +103,6 @@ impl MintNewEditionFromMasterEditionViaToken { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = MintNewEditionFromMasterEditionViaTokenInstructionData::new() .try_to_vec() @@ -413,11 +408,6 @@ impl<'a> MintNewEditionFromMasterEditionViaTokenCpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = MintNewEditionFromMasterEditionViaTokenInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs index fe3ee777..8e7f29f7 100644 --- a/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs +++ b/clients/rust/src/generated/instructions/mint_new_edition_from_master_edition_via_vault_proxy.rs @@ -120,11 +120,6 @@ impl MintNewEditionFromMasterEditionViaVaultProxy { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = MintNewEditionFromMasterEditionViaVaultProxyInstructionData::new() .try_to_vec() @@ -485,11 +480,6 @@ impl<'a> MintNewEditionFromMasterEditionViaVaultProxyCpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = MintNewEditionFromMasterEditionViaVaultProxyInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/revoke_use_authority.rs b/clients/rust/src/generated/instructions/revoke_use_authority.rs index 71172982..ff891144 100644 --- a/clients/rust/src/generated/instructions/revoke_use_authority.rs +++ b/clients/rust/src/generated/instructions/revoke_use_authority.rs @@ -67,11 +67,6 @@ impl RevokeUseAuthority { accounts.push(solana_program::instruction::AccountMeta::new_readonly( rent, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = RevokeUseAuthorityInstructionData::new() .try_to_vec() @@ -272,11 +267,6 @@ impl<'a> RevokeUseAuthorityCpi<'a> { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *rent.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = RevokeUseAuthorityInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/set_and_verify_collection.rs b/clients/rust/src/generated/instructions/set_and_verify_collection.rs index 0d5a583d..df987ba5 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_collection.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_collection.rs @@ -64,11 +64,6 @@ impl SetAndVerifyCollection { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = SetAndVerifyCollectionInstructionData::new() .try_to_vec() @@ -261,11 +256,6 @@ impl<'a> SetAndVerifyCollectionCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = SetAndVerifyCollectionInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs index 82c1404d..7bd3efe4 100644 --- a/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/set_and_verify_sized_collection_item.rs @@ -64,11 +64,6 @@ impl SetAndVerifySizedCollectionItem { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = SetAndVerifySizedCollectionItemInstructionData::new() .try_to_vec() @@ -261,11 +256,6 @@ impl<'a> SetAndVerifySizedCollectionItemCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = SetAndVerifySizedCollectionItemInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/set_collection_size.rs b/clients/rust/src/generated/instructions/set_collection_size.rs index fabe885a..5288be0f 100644 --- a/clients/rust/src/generated/instructions/set_collection_size.rs +++ b/clients/rust/src/generated/instructions/set_collection_size.rs @@ -45,11 +45,6 @@ impl SetCollectionSize { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = SetCollectionSizeInstructionData::new() .try_to_vec() @@ -207,11 +202,6 @@ impl<'a> SetCollectionSizeCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = SetCollectionSizeInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/set_token_standard.rs b/clients/rust/src/generated/instructions/set_token_standard.rs index 2085eab5..9be7820a 100644 --- a/clients/rust/src/generated/instructions/set_token_standard.rs +++ b/clients/rust/src/generated/instructions/set_token_standard.rs @@ -39,11 +39,6 @@ impl SetTokenStandard { accounts.push(solana_program::instruction::AccountMeta::new_readonly( edition, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = SetTokenStandardInstructionData::new().try_to_vec().unwrap(); @@ -162,11 +157,6 @@ impl<'a> SetTokenStandardCpi<'a> { *edition.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = SetTokenStandardInstructionData::new().try_to_vec().unwrap(); diff --git a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs index ebfcc52e..f642b00e 100644 --- a/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs +++ b/clients/rust/src/generated/instructions/transfer_out_of_escrow.rs @@ -96,11 +96,6 @@ impl TransferOutOfEscrow { accounts.push(solana_program::instruction::AccountMeta::new_readonly( authority, true, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = TransferOutOfEscrowInstructionData::new() .try_to_vec() @@ -374,11 +369,6 @@ impl<'a> TransferOutOfEscrowCpi<'a> { *authority.key, true, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = TransferOutOfEscrowInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/unverify_collection.rs b/clients/rust/src/generated/instructions/unverify_collection.rs index ef1bd219..822c79e8 100644 --- a/clients/rust/src/generated/instructions/unverify_collection.rs +++ b/clients/rust/src/generated/instructions/unverify_collection.rs @@ -53,11 +53,6 @@ impl UnverifyCollection { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = UnverifyCollectionInstructionData::new() .try_to_vec() @@ -219,11 +214,6 @@ impl<'a> UnverifyCollectionCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = UnverifyCollectionInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs index 7d714976..1b237d05 100644 --- a/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/unverify_sized_collection_item.rs @@ -58,11 +58,6 @@ impl UnverifySizedCollectionItem { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = UnverifySizedCollectionItemInstructionData::new() .try_to_vec() @@ -238,11 +233,6 @@ impl<'a> UnverifySizedCollectionItemCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = UnverifySizedCollectionItemInstructionData::new() .try_to_vec() diff --git a/clients/rust/src/generated/instructions/utilize.rs b/clients/rust/src/generated/instructions/utilize.rs index 48388170..c14c1973 100644 --- a/clients/rust/src/generated/instructions/utilize.rs +++ b/clients/rust/src/generated/instructions/utilize.rs @@ -79,21 +79,11 @@ impl Utilize { use_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } if let Some(burner) = self.burner { accounts.push(solana_program::instruction::AccountMeta::new_readonly( burner, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = UtilizeInstructionData::new().try_to_vec().unwrap(); let mut args = args.try_to_vec().unwrap(); @@ -336,22 +326,12 @@ impl<'a> UtilizeCpi<'a> { *use_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } if let Some(burner) = self.burner { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *burner.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let mut data = UtilizeInstructionData::new().try_to_vec().unwrap(); let mut args = self.__args.try_to_vec().unwrap(); diff --git a/clients/rust/src/generated/instructions/verify_collection.rs b/clients/rust/src/generated/instructions/verify_collection.rs index d060ce32..c9a7039e 100644 --- a/clients/rust/src/generated/instructions/verify_collection.rs +++ b/clients/rust/src/generated/instructions/verify_collection.rs @@ -58,11 +58,6 @@ impl VerifyCollection { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = VerifyCollectionInstructionData::new().try_to_vec().unwrap(); @@ -236,11 +231,6 @@ impl<'a> VerifyCollectionCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = VerifyCollectionInstructionData::new().try_to_vec().unwrap(); diff --git a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs index 26afce9c..74f97809 100644 --- a/clients/rust/src/generated/instructions/verify_sized_collection_item.rs +++ b/clients/rust/src/generated/instructions/verify_sized_collection_item.rs @@ -58,11 +58,6 @@ impl VerifySizedCollectionItem { collection_authority_record, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = VerifySizedCollectionItemInstructionData::new() .try_to_vec() @@ -238,11 +233,6 @@ impl<'a> VerifySizedCollectionItemCpi<'a> { *collection_authority_record.key, false, )); - } else { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - crate::MPL_TOKEN_METADATA_ID, - false, - )); } let data = VerifySizedCollectionItemInstructionData::new() .try_to_vec() diff --git a/idls/token_metadata.json b/idls/token_metadata.json index b49427b6..b4a47295 100644 --- a/idls/token_metadata.json +++ b/idls/token_metadata.json @@ -9,43 +9,57 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority" + "docs": [ + "Mint authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "update authority info" + "docs": [ + "update authority info" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info" + "docs": [ + "Rent info" + ] } ], "args": [], @@ -61,13 +75,17 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Update authority key" + "docs": [ + "Update authority key" + ] } ], "args": [], @@ -83,79 +101,105 @@ "name": "edition", "isMut": true, "isSigner": false, - "desc": "Unallocated edition V1 account with address as pda of ['metadata', program id, mint, 'edition']" + "docs": [ + "Unallocated edition V1 account with address as pda of ['metadata', program id, mint, 'edition']" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Metadata mint" + "docs": [ + "Metadata mint" + ] }, { "name": "printingMint", "isMut": true, "isSigner": false, - "desc": "Printing mint - A mint you control that can mint tokens that can be exchanged for limited editions of your master edition via the MintNewEditionFromMasterEditionViaToken endpoint" + "docs": [ + "Printing mint - A mint you control that can mint tokens that can be exchanged for limited editions of your master edition via the MintNewEditionFromMasterEditionViaToken endpoint" + ] }, { "name": "oneTimePrintingAuthorizationMint", "isMut": true, "isSigner": false, - "desc": "One time authorization printing mint - A mint you control that prints tokens that gives the bearer permission to mint any number of tokens from the printing mint one time via an endpoint with the token-metadata program for your metadata. Also burns the token." + "docs": [ + "One time authorization printing mint - A mint you control that prints tokens that gives the bearer permission to mint any number of tokens from the printing mint one time via an endpoint with the token-metadata program for your metadata. Also burns the token." + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Current Update authority key" + "docs": [ + "Current Update authority key" + ] }, { "name": "printingMintAuthority", "isMut": false, "isSigner": true, - "desc": "Printing mint authority - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY." + "docs": [ + "Printing mint authority - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY." + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "payer", "isMut": false, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info" + "docs": [ + "Rent info" + ] }, { "name": "oneTimePrintingAuthorizationMintAuthority", "isMut": false, "isSigner": true, - "desc": "One time authorization printing mint authority - must be provided if using max supply. THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY." + "docs": [ + "One time authorization printing mint authority - must be provided if using max supply. THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY." + ] } ], "args": [], @@ -171,101 +215,134 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "New Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "New Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "edition", "isMut": true, "isSigner": false, - "desc": "New Edition V1 (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "New Edition V1 (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + "docs": [ + "Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority of new mint" + "docs": [ + "Mint authority of new mint" + ] }, { "name": "printingMint", "isMut": true, "isSigner": false, - "desc": "Printing Mint of master record edition" + "docs": [ + "Printing Mint of master record edition" + ] }, { "name": "masterTokenAccount", "isMut": true, "isSigner": false, - "desc": "Token account containing Printing mint token to be transferred" + "docs": [ + "Token account containing Printing mint token to be transferred" + ] }, { "name": "editionMarker", "isMut": true, "isSigner": false, - "desc": "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number])" + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number])" + ] }, { "name": "burnAuthority", "isMut": false, "isSigner": true, - "desc": "Burn authority for this token" + "docs": [ + "Burn authority for this token" + ] }, { "name": "payer", "isMut": false, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "masterUpdateAuthority", "isMut": false, "isSigner": false, - "desc": "update authority info for new metadata account" + "docs": [ + "update authority info for new metadata account" + ] }, { "name": "masterMetadata", "isMut": false, "isSigner": false, - "desc": "Master record metadata account" + "docs": [ + "Master record metadata account" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info" + "docs": [ + "Rent info" + ] }, { "name": "reservationList", "isMut": true, "isSigner": false, - "desc": "Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list.", - "optional": true + "isOptional": true, + "docs": [ + "Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list." + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 3 @@ -278,19 +355,25 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "owner", "isMut": false, "isSigner": true, - "desc": "Owner on the token account" + "docs": [ + "Owner on the token account" + ] }, { "name": "token", "isMut": false, "isSigner": false, - "desc": "Account containing tokens from the metadata's mint" + "docs": [ + "Account containing tokens from the metadata's mint" + ] } ], "args": [], @@ -306,19 +389,25 @@ "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "reservationList", "isMut": true, "isSigner": false, - "desc": "PDA for ReservationList of ['metadata', program id, master edition key, 'reservation', resource-key]" + "docs": [ + "PDA for ReservationList of ['metadata', program id, master edition key, 'reservation', resource-key]" + ] }, { "name": "resource", "isMut": false, "isSigner": true, - "desc": "The resource you tied the reservation list too" + "docs": [ + "The resource you tied the reservation list too" + ] } ], "args": [], @@ -334,49 +423,65 @@ "name": "reservationList", "isMut": true, "isSigner": false, - "desc": "PDA for ReservationList of ['metadata', program id, master edition key, 'reservation', resource-key]" + "docs": [ + "PDA for ReservationList of ['metadata', program id, master edition key, 'reservation', resource-key]" + ] }, { "name": "payer", "isMut": false, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Update authority" + "docs": [ + "Update authority" + ] }, { "name": "masterEdition", "isMut": false, "isSigner": false, - "desc": " Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + " Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "resource", "isMut": false, "isSigner": false, - "desc": "A resource you wish to tie the reservation list to. This is so your later visitors who come to redeem can derive your reservation list PDA with something they can easily get at. You choose what this should be." + "docs": [ + "A resource you wish to tie the reservation list to. This is so your later visitors who come to redeem can derive your reservation list PDA with something they can easily get at. You choose what this should be." + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info" + "docs": [ + "Rent info" + ] } ], "args": [], @@ -392,13 +497,17 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata (pda of ['metadata', program id, mint id])" + ] }, { "name": "creator", "isMut": false, "isSigner": true, - "desc": "Creator" + "docs": [ + "Creator" + ] } ], "args": [], @@ -414,55 +523,73 @@ "name": "destination", "isMut": true, "isSigner": false, - "desc": "Destination account" + "docs": [ + "Destination account" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account containing one time authorization token" + "docs": [ + "Token account containing one time authorization token" + ] }, { "name": "oneTimePrintingAuthorizationMint", "isMut": true, "isSigner": false, - "desc": "One time authorization mint" + "docs": [ + "One time authorization mint" + ] }, { "name": "printingMint", "isMut": true, "isSigner": false, - "desc": "Printing mint" + "docs": [ + "Printing mint" + ] }, { "name": "burnAuthority", "isMut": false, "isSigner": true, - "desc": "Burn authority" + "docs": [ + "Burn authority" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "masterEdition", "isMut": false, "isSigner": false, - "desc": "Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent" + "docs": [ + "Rent" + ] } ], "args": [], @@ -478,43 +605,57 @@ "name": "destination", "isMut": true, "isSigner": false, - "desc": "Destination account" + "docs": [ + "Destination account" + ] }, { "name": "printingMint", "isMut": true, "isSigner": false, - "desc": "Printing mint" + "docs": [ + "Printing mint" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Update authority" + "docs": [ + "Update authority" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "masterEdition", "isMut": false, "isSigner": false, - "desc": "Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent" + "docs": [ + "Rent" + ] } ], "args": [], @@ -530,55 +671,73 @@ "name": "edition", "isMut": true, "isSigner": false, - "desc": "Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']" + "docs": [ + "Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Metadata mint" + "docs": [ + "Metadata mint" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Update authority" + "docs": [ + "Update authority" + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info" + "docs": [ + "Rent info" + ] } ], "args": [], @@ -594,86 +753,114 @@ "name": "newMetadata", "isMut": true, "isSigner": false, - "desc": "New Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "New Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "newEdition", "isMut": true, "isSigner": false, - "desc": "New Edition (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "New Edition (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ] }, { "name": "newMint", "isMut": true, "isSigner": false, - "desc": "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "editionMarkPda", "isMut": true, "isSigner": false, - "desc": "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ] }, { "name": "newMintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority of new mint" + "docs": [ + "Mint authority of new mint" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "tokenAccountOwner", "isMut": false, "isSigner": true, - "desc": "owner of token account containing master token (#8)" + "docs": [ + "owner of token account containing master token (#8)" + ] }, { "name": "tokenAccount", "isMut": false, "isSigner": false, - "desc": "token account containing token from master metadata mint" + "docs": [ + "token account containing token from master metadata mint" + ] }, { "name": "newMetadataUpdateAuthority", "isMut": false, "isSigner": false, - "desc": "Update authority info for new metadata" + "docs": [ + "Update authority info for new metadata" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Master record metadata account" + "docs": [ + "Master record metadata account" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [ @@ -684,6 +871,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 11 @@ -696,19 +884,25 @@ "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + "docs": [ + "Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ] }, { "name": "oneTimeAuth", "isMut": true, "isSigner": false, - "desc": "One time authorization mint" + "docs": [ + "One time authorization mint" + ] }, { "name": "printingMint", "isMut": true, "isSigner": false, - "desc": "Printing mint" + "docs": [ + "Printing mint" + ] } ], "args": [], @@ -724,104 +918,138 @@ "name": "newMetadata", "isMut": true, "isSigner": false, - "desc": "New Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "New Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "newEdition", "isMut": true, "isSigner": false, - "desc": "New Edition (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "New Edition (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']" + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']" + ] }, { "name": "newMint", "isMut": true, "isSigner": false, - "desc": "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "editionMarkPda", "isMut": true, "isSigner": false, - "desc": "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ] }, { "name": "newMintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority of new mint" + "docs": [ + "Mint authority of new mint" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "vaultAuthority", "isMut": false, "isSigner": true, - "desc": "Vault authority" + "docs": [ + "Vault authority" + ] }, { "name": "safetyDepositStore", "isMut": false, "isSigner": false, - "desc": "Safety deposit token store account" + "docs": [ + "Safety deposit token store account" + ] }, { "name": "safetyDepositBox", "isMut": false, "isSigner": false, - "desc": "Safety deposit box" + "docs": [ + "Safety deposit box" + ] }, { "name": "vault", "isMut": false, "isSigner": false, - "desc": "Vault" + "docs": [ + "Vault" + ] }, { "name": "newMetadataUpdateAuthority", "isMut": false, "isSigner": false, - "desc": "Update authority info for new metadata" + "docs": [ + "Update authority info for new metadata" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Master record metadata account" + "docs": [ + "Master record metadata account" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "tokenVaultProgram", "isMut": false, "isSigner": false, - "desc": "Token vault program" + "docs": [ + "Token vault program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [ @@ -832,6 +1060,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 13 @@ -844,7 +1073,9 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] } ], "args": [], @@ -860,13 +1091,17 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Update authority key" + "docs": [ + "Update authority key" + ] } ], "args": [ @@ -889,47 +1124,62 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority" + "docs": [ + "Mint authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "update authority info" + "docs": [ + "update authority info" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 16 @@ -942,56 +1192,74 @@ "name": "edition", "isMut": true, "isSigner": false, - "desc": "Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']" + "docs": [ + "Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Metadata mint" + "docs": [ + "Metadata mint" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Update authority" + "docs": [ + "Update authority" + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [ @@ -1002,6 +1270,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 17 @@ -1014,47 +1283,62 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionAuthority", "isMut": true, "isSigner": true, - "desc": "Collection Update authority" + "docs": [ + "Collection Update authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collection", "isMut": false, "isSigner": false, - "desc": "Metadata Account of the Collection" + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEditionAccount", "isMut": false, "isSigner": false, - "desc": "MasterEdition2 Account of the Collection Token" + "docs": [ + "MasterEdition2 Account of the Collection Token" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 18 @@ -1067,69 +1351,91 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "tokenAccount", "isMut": true, "isSigner": false, - "desc": "Token Account Of NFT" + "docs": [ + "Token Account Of NFT" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Mint of the Metadata" + "docs": [ + "Mint of the Metadata" + ] }, { "name": "useAuthority", "isMut": true, "isSigner": true, - "desc": "A Use Authority / Can be the current Owner of the NFT" + "docs": [ + "A Use Authority / Can be the current Owner of the NFT" + ] }, { "name": "owner", "isMut": false, "isSigner": false, - "desc": "Owner" + "docs": [ + "Owner" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "ataProgram", "isMut": false, "isSigner": false, - "desc": "Associated Token program" + "docs": [ + "Associated Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info" + "docs": [ + "Rent info" + ] }, { "name": "useAuthorityRecord", "isMut": true, "isSigner": false, - "desc": "Use Authority Record PDA If present the program Assumes a delegated use authority", - "optional": true + "isOptional": true, + "docs": [ + "Use Authority Record PDA If present the program Assumes a delegated use authority" + ] }, { "name": "burner", "isMut": false, "isSigner": false, - "desc": "Program As Signer (Burner)", - "optional": true + "isOptional": true, + "docs": [ + "Program As Signer (Burner)" + ] } ], "args": [ @@ -1140,6 +1446,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 19 @@ -1152,68 +1459,90 @@ "name": "useAuthorityRecord", "isMut": true, "isSigner": false, - "desc": "Use Authority Record PDA" + "docs": [ + "Use Authority Record PDA" + ] }, { "name": "owner", "isMut": true, "isSigner": true, - "desc": "Owner" + "docs": [ + "Owner" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "user", "isMut": false, "isSigner": false, - "desc": "A Use Authority" + "docs": [ + "A Use Authority" + ] }, { "name": "ownerTokenAccount", "isMut": true, "isSigner": false, - "desc": "Owned Token Account Of Mint" + "docs": [ + "Owned Token Account Of Mint" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of Metadata" + "docs": [ + "Mint of Metadata" + ] }, { "name": "burner", "isMut": false, "isSigner": false, - "desc": "Program As Signer (Burner)" + "docs": [ + "Program As Signer (Burner)" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [ @@ -1224,6 +1553,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 20 @@ -1236,59 +1566,78 @@ "name": "useAuthorityRecord", "isMut": true, "isSigner": false, - "desc": "Use Authority Record PDA" + "docs": [ + "Use Authority Record PDA" + ] }, { "name": "owner", "isMut": true, "isSigner": true, - "desc": "Owner" + "docs": [ + "Owner" + ] }, { "name": "user", "isMut": false, "isSigner": false, - "desc": "A Use Authority" + "docs": [ + "A Use Authority" + ] }, { "name": "ownerTokenAccount", "isMut": true, "isSigner": false, - "desc": "Owned Token Account Of Mint" + "docs": [ + "Owned Token Account Of Mint" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of Metadata" + "docs": [ + "Mint of Metadata" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 21 @@ -1301,41 +1650,54 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionAuthority", "isMut": true, "isSigner": true, - "desc": "Collection Authority" + "docs": [ + "Collection Authority" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collection", "isMut": false, "isSigner": false, - "desc": "Metadata Account of the Collection" + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEditionAccount", "isMut": false, "isSigner": false, - "desc": "MasterEdition2 Account of the Collection Token" + "docs": [ + "MasterEdition2 Account of the Collection Token" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 22 @@ -1348,53 +1710,70 @@ "name": "collectionAuthorityRecord", "isMut": true, "isSigner": false, - "desc": "Collection Authority Record PDA" + "docs": [ + "Collection Authority Record PDA" + ] }, { "name": "newCollectionAuthority", "isMut": false, "isSigner": false, - "desc": "A Collection Authority" + "docs": [ + "A Collection Authority" + ] }, { "name": "updateAuthority", "isMut": true, "isSigner": true, - "desc": "Update Authority of Collection NFT" + "docs": [ + "Update Authority of Collection NFT" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Collection Metadata account" + "docs": [ + "Collection Metadata account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of Collection Metadata" + "docs": [ + "Mint of Collection Metadata" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 23 @@ -1407,31 +1786,41 @@ "name": "collectionAuthorityRecord", "isMut": true, "isSigner": false, - "desc": "Collection Authority Record PDA" + "docs": [ + "Collection Authority Record PDA" + ] }, { "name": "delegateAuthority", "isMut": true, "isSigner": false, - "desc": "Delegated Collection Authority" + "docs": [ + "Delegated Collection Authority" + ] }, { "name": "revokeAuthority", "isMut": true, "isSigner": true, - "desc": "Update Authority, or Delegated Authority, of Collection NFT" + "docs": [ + "Update Authority, or Delegated Authority, of Collection NFT" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of Metadata" + "docs": [ + "Mint of Metadata" + ] } ], "args": [], @@ -1447,53 +1836,70 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionAuthority", "isMut": true, "isSigner": true, - "desc": "Collection Update authority" + "docs": [ + "Collection Update authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "Update Authority of Collection NFT and NFT" + "docs": [ + "Update Authority of Collection NFT and NFT" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collection", "isMut": false, "isSigner": false, - "desc": "Metadata Account of the Collection" + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEditionAccount", "isMut": false, "isSigner": false, - "desc": "MasterEdition2 Account of the Collection Token" + "docs": [ + "MasterEdition2 Account of the Collection Token" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 25 @@ -1506,31 +1912,41 @@ "name": "delegate", "isMut": true, "isSigner": true, - "desc": "Delegate" + "docs": [ + "Delegate" + ] }, { "name": "tokenAccount", "isMut": true, "isSigner": false, - "desc": "Token account to freeze" + "docs": [ + "Token account to freeze" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition" + "docs": [ + "Edition" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Token mint" + "docs": [ + "Token mint" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token Program" + "docs": [ + "Token Program" + ] } ], "args": [], @@ -1546,31 +1962,41 @@ "name": "delegate", "isMut": true, "isSigner": true, - "desc": "Delegate" + "docs": [ + "Delegate" + ] }, { "name": "tokenAccount", "isMut": true, "isSigner": false, - "desc": "Token account to thaw" + "docs": [ + "Token account to thaw" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition" + "docs": [ + "Edition" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Token mint" + "docs": [ + "Token mint" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token Program" + "docs": [ + "Token Program" + ] } ], "args": [], @@ -1586,13 +2012,17 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata (pda of ['metadata', program id, mint id])" + ] }, { "name": "creator", "isMut": false, "isSigner": true, - "desc": "Creator" + "docs": [ + "Creator" + ] } ], "args": [], @@ -1608,47 +2038,62 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata (pda of ['metadata', program id, mint id])" + ] }, { "name": "owner", "isMut": true, "isSigner": true, - "desc": "NFT owner" + "docs": [ + "NFT owner" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Mint of the NFT" + "docs": [ + "Mint of the NFT" + ] }, { "name": "tokenAccount", "isMut": true, "isSigner": false, - "desc": "Token account to close" + "docs": [ + "Token account to close" + ] }, { "name": "masterEditionAccount", "isMut": true, "isSigner": false, - "desc": "MasterEdition2 of the NFT" + "docs": [ + "MasterEdition2 of the NFT" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program" + "docs": [ + "SPL Token Program" + ] }, { "name": "collectionMetadata", "isMut": true, "isSigner": false, - "desc": "Metadata of the Collection", - "optional": true + "isOptional": true, + "docs": [ + "Metadata of the Collection" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 29 @@ -1661,47 +2106,62 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionAuthority", "isMut": false, "isSigner": true, - "desc": "Collection Update authority" + "docs": [ + "Collection Update authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collection", "isMut": true, "isSigner": false, - "desc": "Metadata Account of the Collection" + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEditionAccount", "isMut": false, "isSigner": false, - "desc": "MasterEdition2 Account of the Collection Token" + "docs": [ + "MasterEdition2 Account of the Collection Token" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 30 @@ -1714,47 +2174,62 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionAuthority", "isMut": false, "isSigner": true, - "desc": "Collection Authority" + "docs": [ + "Collection Authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collection", "isMut": true, "isSigner": false, - "desc": "Metadata Account of the Collection" + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEditionAccount", "isMut": false, "isSigner": false, - "desc": "MasterEdition2 Account of the Collection Token" + "docs": [ + "MasterEdition2 Account of the Collection Token" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 31 @@ -1767,53 +2242,70 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionAuthority", "isMut": false, "isSigner": true, - "desc": "Collection Update authority" + "docs": [ + "Collection Update authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "Update Authority of Collection NFT and NFT" + "docs": [ + "Update Authority of Collection NFT and NFT" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collection", "isMut": true, "isSigner": false, - "desc": "Metadata Account of the Collection" + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEditionAccount", "isMut": true, "isSigner": false, - "desc": "MasterEdition2 Account of the Collection Token" + "docs": [ + "MasterEdition2 Account of the Collection Token" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 32 @@ -1826,44 +2318,58 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "mintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority" + "docs": [ + "Mint authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "update authority info" + "docs": [ + "update authority info" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "desc": "Rent info", - "optional": true + "isOptional": true, + "docs": [ + "Rent info" + ] } ], "args": [ @@ -1874,6 +2380,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 33 @@ -1886,26 +2393,34 @@ "name": "collectionMetadata", "isMut": true, "isSigner": false, - "desc": "Collection Metadata account" + "docs": [ + "Collection Metadata account" + ] }, { "name": "collectionAuthority", "isMut": true, "isSigner": true, - "desc": "Collection Update authority" + "docs": [ + "Collection Update authority" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [ @@ -1916,6 +2431,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 34 @@ -1928,29 +2444,38 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": true, - "desc": "Metadata update authority" + "docs": [ + "Metadata update authority" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Edition account" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 35 @@ -1963,32 +2488,42 @@ "name": "collectionMetadata", "isMut": true, "isSigner": false, - "desc": "Collection Metadata account" + "docs": [ + "Collection Metadata account" + ] }, { "name": "collectionAuthority", "isMut": true, "isSigner": true, - "desc": "Collection Update authority" + "docs": [ + "Collection Update authority" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection" + "docs": [ + "Mint of the Collection" + ] }, { "name": "bubblegumSigner", "isMut": false, "isSigner": true, - "desc": "Signing PDA of Bubblegum program" + "docs": [ + "Signing PDA of Bubblegum program" + ] }, { "name": "collectionAuthorityRecord", "isMut": false, "isSigner": false, - "desc": "Collection Authority Record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Collection Authority Record PDA" + ] } ], "args": [ @@ -1999,6 +2534,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 36 @@ -2011,61 +2547,81 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata (pda of ['metadata', program id, mint id])" + ] }, { "name": "owner", "isMut": true, "isSigner": true, - "desc": "NFT owner" + "docs": [ + "NFT owner" + ] }, { "name": "printEditionMint", "isMut": true, "isSigner": false, - "desc": "Mint of the print edition NFT" + "docs": [ + "Mint of the print edition NFT" + ] }, { "name": "masterEditionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the original/master NFT" + "docs": [ + "Mint of the original/master NFT" + ] }, { "name": "printEditionTokenAccount", "isMut": true, "isSigner": false, - "desc": "Token account the print edition NFT is in" + "docs": [ + "Token account the print edition NFT is in" + ] }, { "name": "masterEditionTokenAccount", "isMut": false, "isSigner": false, - "desc": "Token account the Master Edition NFT is in" + "docs": [ + "Token account the Master Edition NFT is in" + ] }, { "name": "masterEditionAccount", "isMut": true, "isSigner": false, - "desc": "MasterEdition2 of the original NFT" + "docs": [ + "MasterEdition2 of the original NFT" + ] }, { "name": "printEditionAccount", "isMut": true, "isSigner": false, - "desc": "Print Edition account of the NFT" + "docs": [ + "Print Edition account of the NFT" + ] }, { "name": "editionMarkerAccount", "isMut": true, "isSigner": false, - "desc": "Edition Marker PDA of the NFT" + "docs": [ + "Edition Marker PDA of the NFT" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program" + "docs": [ + "SPL Token Program" + ] } ], "args": [], @@ -2081,59 +2637,78 @@ "name": "escrow", "isMut": true, "isSigner": false, - "desc": "Escrow account" + "docs": [ + "Escrow account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "tokenAccount", "isMut": false, "isSigner": false, - "desc": "Token account of the token" + "docs": [ + "Token account of the token" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition account" + "docs": [ + "Edition account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Wallet paying for the transaction and new account" + "docs": [ + "Wallet paying for the transaction and new account" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Authority/creator of the escrow account", - "optional": true + "isOptional": true, + "docs": [ + "Authority/creator of the escrow account" + ] } ], "args": [], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 38 @@ -2146,49 +2721,65 @@ "name": "escrow", "isMut": true, "isSigner": false, - "desc": "Escrow account" + "docs": [ + "Escrow account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "tokenAccount", "isMut": false, "isSigner": false, - "desc": "Token account" + "docs": [ + "Token account" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition account" + "docs": [ + "Edition account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Wallet paying for the transaction and new account" + "docs": [ + "Wallet paying for the transaction and new account" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] } ], "args": [], @@ -2204,80 +2795,106 @@ "name": "escrow", "isMut": false, "isSigner": false, - "desc": "Escrow account" + "docs": [ + "Escrow account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Wallet paying for the transaction and new account" + "docs": [ + "Wallet paying for the transaction and new account" + ] }, { "name": "attributeMint", "isMut": false, "isSigner": false, - "desc": "Mint account for the new attribute" + "docs": [ + "Mint account for the new attribute" + ] }, { "name": "attributeSrc", "isMut": true, "isSigner": false, - "desc": "Token account source for the new attribute" + "docs": [ + "Token account source for the new attribute" + ] }, { "name": "attributeDst", "isMut": true, "isSigner": false, - "desc": "Token account, owned by TM, destination for the new attribute" + "docs": [ + "Token account, owned by TM, destination for the new attribute" + ] }, { "name": "escrowMint", "isMut": false, "isSigner": false, - "desc": "Mint account that the escrow is attached" + "docs": [ + "Mint account that the escrow is attached" + ] }, { "name": "escrowAccount", "isMut": false, "isSigner": false, - "desc": "Token account that holds the token the escrow is attached to" + "docs": [ + "Token account that holds the token the escrow is attached to" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "ataProgram", "isMut": false, "isSigner": false, - "desc": "Associated Token program" + "docs": [ + "Associated Token program" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Authority/creator of the escrow account", - "optional": true + "isOptional": true, + "docs": [ + "Authority/creator of the escrow account" + ] } ], "args": [ @@ -2288,6 +2905,7 @@ } } ], + "legacyOptionalAccountsStrategy": true, "discriminant": { "type": "u8", "value": 40 @@ -2300,92 +2918,120 @@ "name": "authority", "isMut": true, "isSigner": true, - "desc": "Asset owner or Utility delegate" + "docs": [ + "Asset owner or Utility delegate" + ] }, { "name": "collectionMetadata", "isMut": true, "isSigner": false, - "desc": "Metadata of the Collection", - "optional": true + "isOptional": true, + "docs": [ + "Metadata of the Collection" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata (pda of ['metadata', program id, mint id])" + ] }, { "name": "edition", "isMut": true, "isSigner": false, - "desc": "Edition of the asset", - "optional": true + "isOptional": true, + "docs": [ + "Edition of the asset" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account to close" + "docs": [ + "Token account to close" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master edition account", - "optional": true + "isOptional": true, + "docs": [ + "Master edition account" + ] }, { "name": "masterEditionMint", "isMut": false, "isSigner": false, - "desc": "Master edition mint of the asset", - "optional": true + "isOptional": true, + "docs": [ + "Master edition mint of the asset" + ] }, { "name": "masterEditionToken", "isMut": false, "isSigner": false, - "desc": "Master edition token account", - "optional": true + "isOptional": true, + "docs": [ + "Master edition token account" + ] }, { "name": "editionMarker", "isMut": true, "isSigner": false, - "desc": "Edition marker account", - "optional": true + "isOptional": true, + "docs": [ + "Edition marker account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program" + "docs": [ + "SPL Token Program" + ] } ], "args": [ @@ -2396,7 +3042,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 41 @@ -2409,56 +3054,74 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Unallocated metadata account with address as pda of ['metadata', program id, mint id]" + "docs": [ + "Unallocated metadata account with address as pda of ['metadata', program id, mint id]" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition']", - "optional": true + "isOptional": true, + "docs": [ + "Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition']" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Mint authority" + "docs": [ + "Mint authority" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "Update authority for the metadata account" + "docs": [ + "Update authority for the metadata account" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token program" + "docs": [ + "SPL Token program" + ] } ], "args": [ @@ -2469,7 +3132,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 42 @@ -2482,97 +3144,127 @@ "name": "token", "isMut": true, "isSigner": false, - "desc": "Token or Associated Token account" + "docs": [ + "Token or Associated Token account" + ] }, { "name": "tokenOwner", "isMut": false, "isSigner": false, - "desc": "Owner of the token account", - "optional": true + "isOptional": true, + "docs": [ + "Owner of the token account" + ] }, { "name": "metadata", "isMut": false, "isSigner": false, - "desc": "Metadata account (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata account (pda of ['metadata', program id, mint id])" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Master Edition account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "mint", "isMut": true, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "(Mint or Update) authority" + "docs": [ + "(Mint or Update) authority" + ] }, { "name": "delegateRecord", "isMut": false, "isSigner": false, - "desc": "Metadata delegate record", - "optional": true + "isOptional": true, + "docs": [ + "Metadata delegate record" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token program" + "docs": [ + "SPL Token program" + ] }, { "name": "splAtaProgram", "isMut": false, "isSigner": false, - "desc": "SPL Associated Token Account program" + "docs": [ + "SPL Associated Token Account program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -2583,7 +3275,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 43 @@ -2596,92 +3287,120 @@ "name": "delegateRecord", "isMut": true, "isSigner": false, - "desc": "Delegate record account", - "optional": true + "isOptional": true, + "docs": [ + "Delegate record account" + ] }, { "name": "delegate", "isMut": false, "isSigner": false, - "desc": "Owner of the delegated account" + "docs": [ + "Owner of the delegated account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "masterEdition", "isMut": false, "isSigner": false, - "desc": "Master Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Master Edition account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of metadata" + "docs": [ + "Mint of metadata" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account of mint", - "optional": true + "isOptional": true, + "docs": [ + "Token account of mint" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Update authority or token owner" + "docs": [ + "Update authority or token owner" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System Program" + "docs": [ + "System Program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program", - "optional": true + "isOptional": true, + "docs": [ + "SPL Token Program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -2692,7 +3411,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 44 @@ -2705,92 +3423,120 @@ "name": "delegateRecord", "isMut": true, "isSigner": false, - "desc": "Delegate record account", - "optional": true + "isOptional": true, + "docs": [ + "Delegate record account" + ] }, { "name": "delegate", "isMut": false, "isSigner": false, - "desc": "Owner of the delegated account" + "docs": [ + "Owner of the delegated account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "masterEdition", "isMut": false, "isSigner": false, - "desc": "Master Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Master Edition account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of metadata" + "docs": [ + "Mint of metadata" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account of mint", - "optional": true + "isOptional": true, + "docs": [ + "Token account of mint" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Update authority or token owner" + "docs": [ + "Update authority or token owner" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System Program" + "docs": [ + "System Program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program", - "optional": true + "isOptional": true, + "docs": [ + "SPL Token Program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -2801,7 +3547,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 45 @@ -2814,85 +3559,111 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Delegate or freeze authority" + "docs": [ + "Delegate or freeze authority" + ] }, { "name": "tokenOwner", "isMut": false, "isSigner": false, - "desc": "Token owner account", - "optional": true + "isOptional": true, + "docs": [ + "Token owner account" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account" + "docs": [ + "Token account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Edition account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program", - "optional": true + "isOptional": true, + "docs": [ + "SPL Token Program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -2903,7 +3674,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 46 @@ -2916,85 +3686,111 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Delegate or freeze authority" + "docs": [ + "Delegate or freeze authority" + ] }, { "name": "tokenOwner", "isMut": false, "isSigner": false, - "desc": "Token owner account", - "optional": true + "isOptional": true, + "docs": [ + "Token owner account" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account" + "docs": [ + "Token account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Edition account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program", - "optional": true + "isOptional": true, + "docs": [ + "SPL Token Program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -3005,7 +3801,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 47 @@ -3018,97 +3813,126 @@ "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "edition", "isMut": true, "isSigner": false, - "desc": "Edition account" + "docs": [ + "Edition account" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account" + "docs": [ + "Token account" + ] }, { "name": "tokenOwner", "isMut": false, "isSigner": false, - "desc": "Token account owner" + "docs": [ + "Token account owner" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Update authority" + "docs": [ + "Update authority" + ] }, { "name": "collectionMetadata", "isMut": false, "isSigner": false, - "desc": "Collection metadata account" + "docs": [ + "Collection metadata account" + ] }, { "name": "delegateRecord", "isMut": false, "isSigner": false, - "desc": "Delegate record account" + "docs": [ + "Delegate record account" + ] }, { "name": "tokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account" + "docs": [ + "Token record account" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instruction sysvar account" + "docs": [ + "Instruction sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program" + "docs": [ + "SPL Token Program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 48 @@ -3121,108 +3945,142 @@ "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account" + "docs": [ + "Token account" + ] }, { "name": "tokenOwner", "isMut": false, "isSigner": false, - "desc": "Token account owner" + "docs": [ + "Token account owner" + ] }, { "name": "destination", "isMut": true, "isSigner": false, - "desc": "Destination token account" + "docs": [ + "Destination token account" + ] }, { "name": "destinationOwner", "isMut": false, "isSigner": false, - "desc": "Destination token account owner" + "docs": [ + "Destination token account owner" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint of token asset" + "docs": [ + "Mint of token asset" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata (pda of ['metadata', program id, mint id])" + "docs": [ + "Metadata (pda of ['metadata', program id, mint id])" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition of token asset", - "optional": true + "isOptional": true, + "docs": [ + "Edition of token asset" + ] }, { "name": "ownerTokenRecord", "isMut": true, "isSigner": false, - "desc": "Owner token record account", - "optional": true + "isOptional": true, + "docs": [ + "Owner token record account" + ] }, { "name": "destinationTokenRecord", "isMut": true, "isSigner": false, - "desc": "Destination token record account", - "optional": true + "isOptional": true, + "docs": [ + "Destination token record account" + ] }, { "name": "authority", "isMut": false, "isSigner": true, - "desc": "Transfer authority (token owner or delegate)" + "docs": [ + "Transfer authority (token owner or delegate)" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System Program" + "docs": [ + "System Program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program" + "docs": [ + "SPL Token Program" + ] }, { "name": "splAtaProgram", "isMut": false, "isSigner": false, - "desc": "SPL Associated Token Account program" + "docs": [ + "SPL Associated Token Account program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -3233,7 +4091,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 49 @@ -3246,72 +4103,94 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Update authority or delegate" + "docs": [ + "Update authority or delegate" + ] }, { "name": "delegateRecord", "isMut": false, "isSigner": false, - "desc": "Delegate record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Delegate record PDA" + ] }, { "name": "token", "isMut": false, "isSigner": false, - "desc": "Token account", - "optional": true + "isOptional": true, + "docs": [ + "Token account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "edition", "isMut": false, "isSigner": false, - "desc": "Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Edition account" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -3322,7 +4201,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 50 @@ -3335,79 +4213,103 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Token owner or delegate" + "docs": [ + "Token owner or delegate" + ] }, { "name": "delegateRecord", "isMut": true, "isSigner": false, - "desc": "Delegate record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Delegate record PDA" + ] }, { "name": "token", "isMut": true, "isSigner": false, - "desc": "Token account", - "optional": true + "isOptional": true, + "docs": [ + "Token account" + ] }, { "name": "mint", "isMut": false, "isSigner": false, - "desc": "Mint account" + "docs": [ + "Mint account" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "edition", "isMut": true, "isSigner": false, - "desc": "Edition account", - "optional": true + "isOptional": true, + "docs": [ + "Edition account" + ] }, { "name": "payer", "isMut": false, "isSigner": true, - "desc": "Payer" + "docs": [ + "Payer" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "SPL Token Program", - "optional": true + "isOptional": true, + "docs": [ + "SPL Token Program" + ] }, { "name": "authorizationRulesProgram", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules Program", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules Program" + ] }, { "name": "authorizationRules", "isMut": false, "isSigner": false, - "desc": "Token Authorization Rules account", - "optional": true + "isOptional": true, + "docs": [ + "Token Authorization Rules account" + ] } ], "args": [ @@ -3418,7 +4320,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 51 @@ -3431,53 +4332,69 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Creator to verify, collection update authority or delegate" + "docs": [ + "Creator to verify, collection update authority or delegate" + ] }, { "name": "delegateRecord", "isMut": false, "isSigner": false, - "desc": "Delegate record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Delegate record PDA" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection", - "optional": true + "isOptional": true, + "docs": [ + "Mint of the Collection" + ] }, { "name": "collectionMetadata", "isMut": true, "isSigner": false, - "desc": "Metadata Account of the Collection", - "optional": true + "isOptional": true, + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "collectionMasterEdition", "isMut": false, "isSigner": false, - "desc": "Master Edition Account of the Collection Token", - "optional": true + "isOptional": true, + "docs": [ + "Master Edition Account of the Collection Token" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] } ], "args": [ @@ -3488,7 +4405,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 52 @@ -3501,46 +4417,60 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Creator to verify, collection (or metadata if parent burned) update authority or delegate" + "docs": [ + "Creator to verify, collection (or metadata if parent burned) update authority or delegate" + ] }, { "name": "delegateRecord", "isMut": false, "isSigner": false, - "desc": "Delegate record PDA", - "optional": true + "isOptional": true, + "docs": [ + "Delegate record PDA" + ] }, { "name": "metadata", "isMut": true, "isSigner": false, - "desc": "Metadata account" + "docs": [ + "Metadata account" + ] }, { "name": "collectionMint", "isMut": false, "isSigner": false, - "desc": "Mint of the Collection", - "optional": true + "isOptional": true, + "docs": [ + "Mint of the Collection" + ] }, { "name": "collectionMetadata", "isMut": true, "isSigner": false, - "desc": "Metadata Account of the Collection", - "optional": true + "isOptional": true, + "docs": [ + "Metadata Account of the Collection" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] } ], "args": [ @@ -3551,7 +4481,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 53 @@ -3564,13 +4493,17 @@ "name": "authority", "isMut": false, "isSigner": true, - "desc": "Authority to collect fees" + "docs": [ + "Authority to collect fees" + ] }, { "name": "pdaAccount", "isMut": false, "isSigner": false, - "desc": "PDA to retrieve fees from" + "docs": [ + "PDA to retrieve fees from" + ] } ], "args": [], @@ -3586,110 +4519,146 @@ "name": "editionMetadata", "isMut": true, "isSigner": false, - "desc": "New Metadata key (pda of ['metadata', program id, mint id])" + "docs": [ + "New Metadata key (pda of ['metadata', program id, mint id])" + ] }, { "name": "edition", "isMut": true, "isSigner": false, - "desc": "New Edition (pda of ['metadata', program id, mint id, 'edition'])" + "docs": [ + "New Edition (pda of ['metadata', program id, mint id, 'edition'])" + ] }, { "name": "editionMint", "isMut": true, "isSigner": false, - "desc": "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + "docs": [ + "Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] }, { "name": "editionTokenAccountOwner", "isMut": false, "isSigner": false, - "desc": "Owner of the token account of new token" + "docs": [ + "Owner of the token account of new token" + ] }, { "name": "editionTokenAccount", "isMut": true, "isSigner": false, - "desc": "Token account of new token" + "docs": [ + "Token account of new token" + ] }, { "name": "editionMintAuthority", "isMut": false, "isSigner": true, - "desc": "Mint authority of new mint" + "docs": [ + "Mint authority of new mint" + ] }, { "name": "editionTokenRecord", "isMut": true, "isSigner": false, - "desc": "Token record account", - "optional": true + "isOptional": true, + "docs": [ + "Token record account" + ] }, { "name": "masterEdition", "isMut": true, "isSigner": false, - "desc": "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ] }, { "name": "editionMarkerPda", "isMut": true, "isSigner": false, - "desc": "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "desc": "payer" + "docs": [ + "payer" + ] }, { "name": "masterTokenAccountOwner", "isMut": false, "isSigner": true, - "desc": "owner of token account containing master token" + "docs": [ + "owner of token account containing master token" + ] }, { "name": "masterTokenAccount", "isMut": false, "isSigner": false, - "desc": "token account containing token from master metadata mint" + "docs": [ + "token account containing token from master metadata mint" + ] }, { "name": "masterMetadata", "isMut": false, "isSigner": false, - "desc": "Master record metadata account" + "docs": [ + "Master record metadata account" + ] }, { "name": "updateAuthority", "isMut": false, "isSigner": false, - "desc": "The update authority of the master edition." + "docs": [ + "The update authority of the master edition." + ] }, { "name": "splTokenProgram", "isMut": false, "isSigner": false, - "desc": "Token program" + "docs": [ + "Token program" + ] }, { "name": "splAtaProgram", "isMut": false, "isSigner": false, - "desc": "SPL Associated Token Account program" + "docs": [ + "SPL Associated Token Account program" + ] }, { "name": "sysvarInstructions", "isMut": false, "isSigner": false, - "desc": "Instructions sysvar account" + "docs": [ + "Instructions sysvar account" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "desc": "System program" + "docs": [ + "System program" + ] } ], "args": [ @@ -3700,7 +4669,6 @@ } } ], - "defaultOptionalAccounts": true, "discriminant": { "type": "u8", "value": 55 @@ -6758,7 +7726,7 @@ "metadata": { "origin": "shank", "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", - "binaryVersion": "0.0.11", - "libVersion": "0.0.11" + "binaryVersion": "0.2.0", + "libVersion": "0.2.0" } } \ No newline at end of file diff --git a/programs/token-metadata/Cargo.lock b/programs/token-metadata/Cargo.lock index dd73a427..ac29ec72 100644 --- a/programs/token-metadata/Cargo.lock +++ b/programs/token-metadata/Cargo.lock @@ -3380,6 +3380,15 @@ dependencies = [ "shank_macro 0.0.11", ] +[[package]] +name = "shank" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc647510fc0d94a936f7367a9e3e30edbefd410068747ce4d4084b19b5fdbab" +dependencies = [ + "shank_macro 0.2.1", +] + [[package]] name = "shank_macro" version = "0.0.10" @@ -3404,6 +3413,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "shank_macro" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9ec31d18dcca23f2270ccf69766a99156792da3aed050dc5713af0e778b4f2" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "shank_macro_impl 0.2.1", + "shank_render", + "syn 1.0.109", +] + [[package]] name = "shank_macro_impl" version = "0.0.10" @@ -3430,6 +3452,30 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "shank_macro_impl" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccaeb1359cf545507b5d18a637cc5cf192c7dcc8c737dff466013ca2d9e792c7" +dependencies = [ + "anyhow", + "proc-macro2 1.0.66", + "quote 1.0.32", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "shank_render" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63f0b763c4c767dfb462a884d5f5b9b99fdd0a214c910d95792eb02a13b3d69" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "shank_macro_impl 0.2.1", +] + [[package]] name = "sharded-slab" version = "0.1.4" @@ -5035,12 +5081,12 @@ dependencies = [ "rooster", "serde", "serde_with 1.14.0", - "shank 0.0.11", + "shank 0.2.1", "solana-program", "solana-program-test", "solana-sdk", - "spl-associated-token-account 1.1.3", - "spl-token 3.5.0", + "spl-associated-token-account 2.0.0", + "spl-token 4.0.0", "thiserror", ] diff --git a/programs/token-metadata/program/Cargo.toml b/programs/token-metadata/program/Cargo.toml index 3a0f9070..1c422c45 100644 --- a/programs/token-metadata/program/Cargo.toml +++ b/programs/token-metadata/program/Cargo.toml @@ -23,7 +23,7 @@ num-derive = "0.3" num-traits = "0.2" serde = { version = "1.0.149", optional = true } serde_with = { version = "1.14.0", optional = true } -shank = "0.0.11" +shank = "0.2.0" solana-program = ">= 1.14.13, < 1.17" spl-token = { version = ">= 3.5.0, < 5.0", features = ["no-entrypoint"] } spl-associated-token-account = { version = ">= 1.1.3, < 3.0", features = ["no-entrypoint"] } diff --git a/programs/token-metadata/program/src/instruction/mod.rs b/programs/token-metadata/program/src/instruction/mod.rs index 9681e20c..c9e448ad 100644 --- a/programs/token-metadata/program/src/instruction/mod.rs +++ b/programs/token-metadata/program/src/instruction/mod.rs @@ -99,6 +99,7 @@ pub enum MetadataInstruction { #[account(13, name="system_program", desc="System program")] #[account(14, name="rent", desc="Rent info")] #[account(15, optional, writable, name="reservation_list", desc="Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list.")] + #[legacy_optional_accounts_strategy] DeprecatedMintNewEditionFromMasterEditionViaPrintingToken, /// Allows updating the primary sale boolean on Metadata solely through owning an account @@ -197,6 +198,7 @@ pub enum MetadataInstruction { #[account(11, name="token_program", desc="Token program")] #[account(12, name="system_program", desc="System program")] #[account(13, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] MintNewEditionFromMasterEditionViaToken(MintNewEditionFromMasterEditionViaTokenArgs), /// Converts the Master Edition V1 to a Master Edition V2, draining lamports from the two printing mints @@ -225,6 +227,7 @@ pub enum MetadataInstruction { #[account(14, name="token_vault_program", desc="Token vault program")] #[account(15, name="system_program", desc="System program")] #[account(16, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] MintNewEditionFromMasterEditionViaVaultProxy(MintNewEditionFromMasterEditionViaTokenArgs), /// Puff a Metadata - make all of it's variable length fields (name/uri/symbol) a fixed length using a null character @@ -245,6 +248,7 @@ pub enum MetadataInstruction { #[account(4, name="update_authority", desc="update authority info")] #[account(5, name="system_program", desc="System program")] #[account(6, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] CreateMetadataAccountV2, /// Register a Metadata as a Master Edition V2, which means Edition V2s can be minted. @@ -259,6 +263,7 @@ pub enum MetadataInstruction { #[account(6, name="token_program", desc="Token program")] #[account(7, name="system_program", desc="System program")] #[account(8, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] CreateMasterEditionV3(CreateMasterEditionArgs), /// If a MetadataAccount Has a Collection allow the UpdateAuthority of the Collection to Verify the NFT Belongs in the Collection. @@ -269,6 +274,7 @@ pub enum MetadataInstruction { #[account(4, name="collection", desc="Metadata Account of the Collection")] #[account(5, name="collection_master_edition_account", desc="MasterEdition2 Account of the Collection Token")] #[account(6, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] VerifyCollection, /// Utilize or Use an NFT , burns the NFT and returns the lamports to the update authority if the use method is burn and its out of uses. @@ -286,6 +292,7 @@ pub enum MetadataInstruction { #[account(8, name="rent", desc="Rent info")] #[account(9, optional, writable, name="use_authority_record", desc="Use Authority Record PDA If present the program Assumes a delegated use authority")] #[account(10, optional, name="burner", desc="Program As Signer (Burner)")] + #[legacy_optional_accounts_strategy] Utilize(UtilizeArgs), /// Approve another account to call [utilize] on this NFT. @@ -300,6 +307,7 @@ pub enum MetadataInstruction { #[account(8, name="token_program", desc="Token program")] #[account(9, name="system_program", desc="System program")] #[account(10, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] ApproveUseAuthority(ApproveUseAuthorityArgs), /// Revoke account to call [utilize] on this NFT. @@ -312,6 +320,7 @@ pub enum MetadataInstruction { #[account(6, name="token_program", desc="Token program")] #[account(7, name="system_program", desc="System program")] #[account(8, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] RevokeUseAuthority, /// If a MetadataAccount Has a Collection allow an Authority of the Collection to unverify an NFT in a Collection. @@ -321,6 +330,7 @@ pub enum MetadataInstruction { #[account(3, name="collection", desc="Metadata Account of the Collection")] #[account(4, name="collection_master_edition_account", desc="MasterEdition2 Account of the Collection Token")] #[account(5, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] UnverifyCollection, /// Approve another account to verify NFTs belonging to a collection, [verify_collection] on the collection NFT. @@ -332,6 +342,7 @@ pub enum MetadataInstruction { #[account(5, name="mint", desc="Mint of Collection Metadata")] #[account(6, name="system_program", desc="System program")] #[account(7, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] ApproveCollectionAuthority, /// Revoke account to call [verify_collection] on this NFT. @@ -352,6 +363,7 @@ pub enum MetadataInstruction { #[account(5, name="collection", desc="Metadata Account of the Collection")] #[account(6, name="collection_master_edition_account", desc="MasterEdition2 Account of the Collection Token")] #[account(7, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] SetAndVerifyCollection, /// Allow freezing of an NFT if this user is the delegate of the NFT. @@ -383,6 +395,7 @@ pub enum MetadataInstruction { #[account(4, writable, name="master_edition_account", desc="MasterEdition2 of the NFT")] #[account(5, name="spl_token_program", desc="SPL Token Program")] #[account(6, optional, writable, name="collection_metadata", desc="Metadata of the Collection")] + #[legacy_optional_accounts_strategy] BurnNft, /// Verify Collection V2, new in v1.3--supports Collection Details. @@ -394,6 +407,7 @@ pub enum MetadataInstruction { #[account(4, writable, name="collection", desc="Metadata Account of the Collection")] #[account(5, name="collection_master_edition_account", desc="MasterEdition2 Account of the Collection Token")] #[account(6, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] VerifySizedCollectionItem, /// Unverify Collection V2, new in v1.3--supports Collection Details. @@ -405,6 +419,7 @@ pub enum MetadataInstruction { #[account(4, writable, name="collection", desc="Metadata Account of the Collection")] #[account(5, name="collection_master_edition_account", desc="MasterEdition2 Account of the Collection Token")] #[account(6, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] UnverifySizedCollectionItem, // Set And Verify V2, new in v1.3--supports Collection Details. @@ -418,6 +433,7 @@ pub enum MetadataInstruction { #[account(5, writable, name="collection", desc="Metadata Account of the Collection")] #[account(6, writable, name="collection_master_edition_account", desc="MasterEdition2 Account of the Collection Token")] #[account(7, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] SetAndVerifySizedCollectionItem, /// Create Metadata object. @@ -428,6 +444,7 @@ pub enum MetadataInstruction { #[account(4, name="update_authority", desc="update authority info")] #[account(5, name="system_program", desc="System program")] #[account(6, optional, name="rent", desc="Rent info")] + #[legacy_optional_accounts_strategy] CreateMetadataAccountV3(CreateMetadataAccountArgsV3), /// Set size of an existing collection. @@ -435,6 +452,7 @@ pub enum MetadataInstruction { #[account(1, signer, writable, name="collection_authority", desc="Collection Update authority")] #[account(2, name="collection_mint", desc="Mint of the Collection")] #[account(3, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] SetCollectionSize(SetCollectionSizeArgs), /// Set the token standard of the asset. @@ -442,6 +460,7 @@ pub enum MetadataInstruction { #[account(1, signer, name="update_authority", desc="Metadata update authority")] #[account(2, name="mint", desc="Mint account")] #[account(3, optional, name="edition", desc="Edition account")] + #[legacy_optional_accounts_strategy] SetTokenStandard, /// Set size of an existing collection using CPI from the Bubblegum program. This is how @@ -451,6 +470,7 @@ pub enum MetadataInstruction { #[account(2, name="collection_mint", desc="Mint of the Collection")] #[account(3, signer, name="bubblegum_signer", desc="Signing PDA of Bubblegum program")] #[account(4, optional, name="collection_authority_record", desc="Collection Authority Record PDA")] + #[legacy_optional_accounts_strategy] BubblegumSetCollectionSize(SetCollectionSizeArgs), /// Completely burn a print edition NFT. @@ -476,6 +496,7 @@ pub enum MetadataInstruction { #[account(6, name="system_program", desc="System program")] #[account(7, name="sysvar_instructions", desc="Instructions sysvar account")] #[account(8, optional, signer, name="authority", desc="Authority/creator of the escrow account")] + #[legacy_optional_accounts_strategy] CreateEscrowAccount, /// Close the escrow account. @@ -503,6 +524,7 @@ pub enum MetadataInstruction { #[account(10, name="token_program", desc="Token program")] #[account(11, name="sysvar_instructions", desc="Instructions sysvar account")] #[account(12, optional, signer, name="authority", desc="Authority/creator of the escrow account")] + #[legacy_optional_accounts_strategy] TransferOutOfEscrow(TransferOutOfEscrowArgs), //---- New API @@ -547,7 +569,6 @@ pub enum MetadataInstruction { #[account(11, name="system_program", desc="System program")] #[account(12, name="sysvar_instructions", desc="Instructions sysvar account")] #[account(13, name="spl_token_program", desc="SPL Token Program")] - #[default_optional_accounts] Burn(BurnArgs), /// Creates the metadata and associated accounts for a new or existing mint account. @@ -567,7 +588,6 @@ pub enum MetadataInstruction { #[account(8, name="spl_token_program", desc="SPL Token program")] #[args(initialize_mint: bool)] #[args(update_authority_as_signer: bool)] - #[default_optional_accounts] Create(CreateArgs), /// Mints tokens from a mint account into the specified token account. @@ -591,7 +611,6 @@ pub enum MetadataInstruction { #[account(12, name="spl_ata_program", desc="SPL Associated Token Account program")] #[account(13, optional, name="authorization_rules_program", desc="Token Authorization Rules program")] #[account(14, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Mint(MintArgs), /// Creates a delegate for an asset. @@ -616,7 +635,6 @@ pub enum MetadataInstruction { #[account(11, optional, name="spl_token_program", desc="SPL Token Program")] #[account(12, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(13, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Delegate(DelegateArgs), /// Revokes a delegate. @@ -636,7 +654,6 @@ pub enum MetadataInstruction { #[account(11, optional, name="spl_token_program", desc="SPL Token Program")] #[account(12, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(13, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Revoke(RevokeArgs), /// Locks an asset. For non-programmable assets, this will also freeze the token account. @@ -656,7 +673,6 @@ pub enum MetadataInstruction { #[account(10, optional, name="spl_token_program", desc="SPL Token Program")] #[account(11, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(12, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Lock(LockArgs), /// Unlocks an asset. For non-programmable assets, this will also thaw the token account. @@ -676,7 +692,6 @@ pub enum MetadataInstruction { #[account(10, optional, name="spl_token_program", desc="SPL Token Program")] #[account(11, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(12, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Unlock(UnlockArgs), /// Migrates an asset to a ProgrammableAsset type. @@ -695,7 +710,6 @@ pub enum MetadataInstruction { #[account(12, name="spl_token_program", desc="SPL Token Program")] #[account(13, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(14, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Migrate, /// Transfer an asset. @@ -719,7 +733,6 @@ pub enum MetadataInstruction { #[account(14, name="spl_ata_program", desc="SPL Associated Token Account program")] #[account(15, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(16, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Transfer(TransferArgs), /// Updates the metadata of an asset. @@ -737,7 +750,6 @@ pub enum MetadataInstruction { #[account(8, name="sysvar_instructions", desc="Instructions sysvar account")] #[account(9, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(10, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Update(UpdateArgs), /// Uses an asset. @@ -758,7 +770,6 @@ pub enum MetadataInstruction { #[account(9, optional, name="spl_token_program", desc="SPL Token Program")] #[account(10, optional, name="authorization_rules_program", desc="Token Authorization Rules Program")] #[account(11, optional, name="authorization_rules", desc="Token Authorization Rules account")] - #[default_optional_accounts] Use(UseArgs), /// Verifies that an asset was created by a specific creator or belongs in an specified collection. @@ -773,7 +784,6 @@ pub enum MetadataInstruction { #[account(5, optional, name="collection_master_edition", desc="Master Edition Account of the Collection Token")] #[account(6, name="system_program", desc="System program")] #[account(7, name="sysvar_instructions", desc="Instructions sysvar account")] - #[default_optional_accounts] Verify(VerificationArgs), /// Unverifies that an asset was created by a specific creator or belongs in an specified collection. @@ -787,7 +797,6 @@ pub enum MetadataInstruction { #[account(4, optional, writable, name="collection_metadata", desc="Metadata Account of the Collection")] #[account(5, name="system_program", desc="System program")] #[account(6, name="sysvar_instructions", desc="Instructions sysvar account")] - #[default_optional_accounts] Unverify(VerificationArgs), /// Collect fees stored on PDA accounts. @@ -816,7 +825,6 @@ pub enum MetadataInstruction { #[account(16, name="sysvar_instructions", desc="Instructions sysvar account")] #[account(17, name="system_program", desc="System program")] #[args(initialize_mint: bool)] - #[default_optional_accounts] Print(PrintArgs), } From 201dac3b9aae62083022229f666dfe7fa2fd31a1 Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 24 Aug 2023 16:06:46 +0300 Subject: [PATCH 27/31] Tweaks --- clients/rust/README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/clients/rust/README.md b/clients/rust/README.md index acfe90d5..ab9a4db1 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -1,4 +1,4 @@ -

+

Metaplex Token Metadata SDK

@@ -9,14 +9,23 @@

- ## Getting started +## Why using a client library (SDK)? + + Using a program crate as a dependency has its caveats. The main one is that you are bound to the same dependencies of that program, which tend to be quite a few. In many cases, this leads to dependency problems when trying to update crate versions. Secondly, the program crate is generated from the program source code, which its main purpose is to offer the functionality of the program, not necessarily a _friendly_ client API. + + Enter an SDK crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. + + > **Note** + > Although the SDK crate has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies of the `solana-program`. + +## Getting started From your project folder: ```bash cargo add mpl-token-metadata ``` - ## Structure +## Structure The client SDK is divided into several modules: @@ -89,7 +98,7 @@ let create_ix = CreateV1 { }; // creates the instruction -let create_ix = create_instruction(args); +let create_ix = create_ix.instruction(args); ``` Alternatively, you can use the `CreateV1Builder` to create the appropriate instruction: @@ -251,15 +260,6 @@ impl Metadata { ``` > If a bump seed is known, it is _cheaper_ (in terms of compute units) to use the `create_pda` function, in particular for on-chain code. - ## Why using a client library (SDK)? - - Using a program crate as a dependency has its caveats. The main one is that you are bound to the same dependencies of that program, which tend to be quite a few. In many cases, this leads to dependency problems when trying to update crate versions. Secondly, the program crate is generated from the program source code, which its main purpose is to offer the functionality of the program, not necessarily a _friendly_ client API. - - Enter an SDK crate: minimal dependencies, useful helpers. By autogenerating a client SDK to include all `accounts`, `types`, `instructions` and `errors` from a program using the IDL, we can significantly reduce the number of dependencies. The autogenerated code can be refined by adding (manually-written) helpers. - - > **Note** - > Although the SDK crate has 5 dependencies, in practice the only "real" dependency is the `solana-program` crate since the remaining 4 dependencies are also dependencies of the `solana-program`. - ## Testing To run the SDK tests, run the following from the root directory of the repository: From afbd51c8947e8ddf2984644b929a45570c7df11b Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 24 Aug 2023 18:20:47 +0300 Subject: [PATCH 28/31] Pass all arguments to test --- configs/client-scripts/test-js-client.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configs/client-scripts/test-js-client.sh b/configs/client-scripts/test-js-client.sh index 5493aa01..5c4704aa 100755 --- a/configs/client-scripts/test-js-client.sh +++ b/configs/client-scripts/test-js-client.sh @@ -11,6 +11,4 @@ ARGS=$* # js client tests folder cd ${WORKING_DIR}/clients/js -for t in `ls test/${ARGS}*`; do - pnpm build && pnpm test ${t} -done +pnpm install && pnpm build && pnpm test ${ARGS} From 7db08e32baaa7675110eaeba5773f3ed325a6fda Mon Sep 17 00:00:00 2001 From: febo Date: Thu, 24 Aug 2023 20:39:45 +0300 Subject: [PATCH 29/31] Update size config --- clients/js/src/generated/accounts/masterEdition.ts | 4 ---- clients/js/src/generated/accounts/metadata.ts | 4 ---- .../js/src/generated/accounts/metadataDelegateRecord.ts | 4 ---- clients/js/src/generated/accounts/tokenRecord.ts | 4 ---- clients/rust/src/generated/accounts/master_edition.rs | 2 -- clients/rust/src/generated/accounts/metadata.rs | 2 -- .../src/generated/accounts/metadata_delegate_record.rs | 2 -- clients/rust/src/generated/accounts/token_record.rs | 2 -- configs/kinobi.cjs | 8 ++++---- 9 files changed, 4 insertions(+), 28 deletions(-) diff --git a/clients/js/src/generated/accounts/masterEdition.ts b/clients/js/src/generated/accounts/masterEdition.ts index 35ae997d..2806fa39 100644 --- a/clients/js/src/generated/accounts/masterEdition.ts +++ b/clients/js/src/generated/accounts/masterEdition.ts @@ -168,10 +168,6 @@ export function getMasterEditionGpaBuilder( .whereField('key', Key.MasterEditionV2); } -export function getMasterEditionSize(): number { - return 282; -} - export function findMasterEditionPda( context: Pick, seeds: { diff --git a/clients/js/src/generated/accounts/metadata.ts b/clients/js/src/generated/accounts/metadata.ts index 57719a6f..49288a16 100644 --- a/clients/js/src/generated/accounts/metadata.ts +++ b/clients/js/src/generated/accounts/metadata.ts @@ -250,10 +250,6 @@ export function getMetadataGpaBuilder( .whereField('key', Key.MetadataV1); } -export function getMetadataSize(): number { - return 679; -} - export function findMetadataPda( context: Pick, seeds: { diff --git a/clients/js/src/generated/accounts/metadataDelegateRecord.ts b/clients/js/src/generated/accounts/metadataDelegateRecord.ts index c4553253..116e45dd 100644 --- a/clients/js/src/generated/accounts/metadataDelegateRecord.ts +++ b/clients/js/src/generated/accounts/metadataDelegateRecord.ts @@ -184,10 +184,6 @@ export function getMetadataDelegateRecordGpaBuilder( ); } -export function getMetadataDelegateRecordSize(): number { - return 98; -} - export function findMetadataDelegateRecordPda( context: Pick, seeds: { diff --git a/clients/js/src/generated/accounts/tokenRecord.ts b/clients/js/src/generated/accounts/tokenRecord.ts index 294405f8..050e8b85 100644 --- a/clients/js/src/generated/accounts/tokenRecord.ts +++ b/clients/js/src/generated/accounts/tokenRecord.ts @@ -191,10 +191,6 @@ export function getTokenRecordGpaBuilder( .whereField('key', Key.TokenRecord); } -export function getTokenRecordSize(): number { - return 80; -} - export function findTokenRecordPda( context: Pick, seeds: { diff --git a/clients/rust/src/generated/accounts/master_edition.rs b/clients/rust/src/generated/accounts/master_edition.rs index 6cc68b4d..db1b6b3f 100644 --- a/clients/rust/src/generated/accounts/master_edition.rs +++ b/clients/rust/src/generated/accounts/master_edition.rs @@ -18,8 +18,6 @@ pub struct MasterEdition { } impl MasterEdition { - pub const LEN: usize = 282; - pub fn find_pda(mint: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { solana_program::pubkey::Pubkey::find_program_address( &[ diff --git a/clients/rust/src/generated/accounts/metadata.rs b/clients/rust/src/generated/accounts/metadata.rs index ce9ab4f7..033b4c07 100644 --- a/clients/rust/src/generated/accounts/metadata.rs +++ b/clients/rust/src/generated/accounts/metadata.rs @@ -37,8 +37,6 @@ pub struct Metadata { } impl Metadata { - pub const LEN: usize = 679; - pub fn find_pda(mint: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { solana_program::pubkey::Pubkey::find_program_address( &[ diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs index 17c61b50..9d67dcf9 100644 --- a/clients/rust/src/generated/accounts/metadata_delegate_record.rs +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -21,8 +21,6 @@ pub struct MetadataDelegateRecord { } impl MetadataDelegateRecord { - pub const LEN: usize = 98; - pub fn find_pda( mint: &Pubkey, delegate_role: MetadataDelegateRoleSeed, diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs index 7840e082..ea5093b7 100644 --- a/clients/rust/src/generated/accounts/token_record.rs +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -24,8 +24,6 @@ pub struct TokenRecord { } impl TokenRecord { - pub const LEN: usize = 80; - pub fn find_pda(mint: &Pubkey, token: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { solana_program::pubkey::Pubkey::find_program_address( &[ diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index 1e388995..b7476cd0 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -25,11 +25,11 @@ const metadataSeeds = [ kinobi.update( new k.UpdateAccountsVisitor({ metadata: { - size: 679, + size: undefined, seeds: metadataSeeds, }, masterEditionV2: { - size: 282, + size: undefined, name: "masterEdition", seeds: [...metadataSeeds, k.stringConstantSeed("edition")], }, @@ -51,7 +51,7 @@ kinobi.update( ], }, tokenRecord: { - size: 80, + size: undefined, seeds: [ ...metadataSeeds, k.stringConstantSeed("token_record"), @@ -62,7 +62,7 @@ kinobi.update( ], }, metadataDelegateRecord: { - size: 98, + size: undefined, seeds: [ ...metadataSeeds, k.variableSeed( From 813aa9b4cf64bc2fd58b77776540b20b9df31e02 Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 25 Aug 2023 00:11:53 +0300 Subject: [PATCH 30/31] Add size information --- clients/js/src/generated/accounts/metadataDelegateRecord.ts | 4 ++++ clients/js/src/generated/accounts/tokenRecord.ts | 4 ++++ .../rust/src/generated/accounts/metadata_delegate_record.rs | 2 ++ clients/rust/src/generated/accounts/token_record.rs | 2 ++ configs/kinobi.cjs | 4 ++-- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/clients/js/src/generated/accounts/metadataDelegateRecord.ts b/clients/js/src/generated/accounts/metadataDelegateRecord.ts index 116e45dd..c4553253 100644 --- a/clients/js/src/generated/accounts/metadataDelegateRecord.ts +++ b/clients/js/src/generated/accounts/metadataDelegateRecord.ts @@ -184,6 +184,10 @@ export function getMetadataDelegateRecordGpaBuilder( ); } +export function getMetadataDelegateRecordSize(): number { + return 98; +} + export function findMetadataDelegateRecordPda( context: Pick, seeds: { diff --git a/clients/js/src/generated/accounts/tokenRecord.ts b/clients/js/src/generated/accounts/tokenRecord.ts index 050e8b85..294405f8 100644 --- a/clients/js/src/generated/accounts/tokenRecord.ts +++ b/clients/js/src/generated/accounts/tokenRecord.ts @@ -191,6 +191,10 @@ export function getTokenRecordGpaBuilder( .whereField('key', Key.TokenRecord); } +export function getTokenRecordSize(): number { + return 80; +} + export function findTokenRecordPda( context: Pick, seeds: { diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs index 9d67dcf9..17c61b50 100644 --- a/clients/rust/src/generated/accounts/metadata_delegate_record.rs +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -21,6 +21,8 @@ pub struct MetadataDelegateRecord { } impl MetadataDelegateRecord { + pub const LEN: usize = 98; + pub fn find_pda( mint: &Pubkey, delegate_role: MetadataDelegateRoleSeed, diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs index ea5093b7..7840e082 100644 --- a/clients/rust/src/generated/accounts/token_record.rs +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -24,6 +24,8 @@ pub struct TokenRecord { } impl TokenRecord { + pub const LEN: usize = 80; + pub fn find_pda(mint: &Pubkey, token: &Pubkey) -> (solana_program::pubkey::Pubkey, u8) { solana_program::pubkey::Pubkey::find_program_address( &[ diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index b7476cd0..f8a54e6d 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -51,7 +51,7 @@ kinobi.update( ], }, tokenRecord: { - size: undefined, + size: 80, seeds: [ ...metadataSeeds, k.stringConstantSeed("token_record"), @@ -62,7 +62,7 @@ kinobi.update( ], }, metadataDelegateRecord: { - size: undefined, + size: 98, seeds: [ ...metadataSeeds, k.variableSeed( From 2f6e55997e8c262cf4b7f832cb06e5e258d0a24c Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 25 Aug 2023 00:12:11 +0300 Subject: [PATCH 31/31] Use size constants --- clients/js/src/hooked/resolvers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clients/js/src/hooked/resolvers.ts b/clients/js/src/hooked/resolvers.ts index 280e44e4..0ac7f73f 100644 --- a/clients/js/src/hooked/resolvers.ts +++ b/clients/js/src/hooked/resolvers.ts @@ -21,12 +21,14 @@ import { findEditionMarkerV2Pda, findMasterEditionPda, findTokenRecordPda, - getMasterEditionSize, - getMetadataSize, printSupply, } from '../generated'; import { findEditionMarkerFromEditionNumberPda } from './editionMarker'; +const METADATA_SIZE: number = 679; + +const MASTER_EDITION_SIZE: number = 282; + export const resolveCollectionDetails = ( context: any, accounts: any, @@ -103,9 +105,9 @@ export const resolveCreateV1Bytes = ( programId: any, isWritable?: boolean ): number => { - const base = getMintSize() + getMetadataSize() + 2 * ACCOUNT_HEADER_SIZE; + const base = getMintSize() + METADATA_SIZE + 2 * ACCOUNT_HEADER_SIZE; if (isNonFungible(args.tokenStandard)) { - return base + getMasterEditionSize() + ACCOUNT_HEADER_SIZE; + return base + MASTER_EDITION_SIZE + ACCOUNT_HEADER_SIZE; } return base; };