Skip to content

Commit

Permalink
feat: add wallet_standard to external exports
Browse files Browse the repository at this point in the history
Also remove `derive_more` and `Debug` traits from generated
`wasm_client_anchor` macros.
  • Loading branch information
ifiokjr committed Sep 13, 2024
1 parent 23c0b96 commit f9da644
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/wasm_client_anchor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ crate-type = ["cdylib", "lib"]
[dependencies]
anchor-lang = { workspace = true }
async-trait = { workspace = true }
derive_more = { workspace = true, features = ["debug"] }
log = { workspace = true }
paste = { workspace = true }
retrier = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/wasm_client_anchor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ pub mod prelude {

pub mod external {
pub use anchor_lang;
pub use derive_more;
pub use paste;
pub use solana_sdk;
pub use typed_builder;
pub use wallet_standard;
pub use wasm_client_solana;
}
8 changes: 3 additions & 5 deletions crates/wasm_client_anchor/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ macro_rules! base_create_request_builder {
),
>;

#[derive($crate::external::derive_more::Debug, $crate::external::typed_builder::TypedBuilder)]
#[derive($crate::external::typed_builder::TypedBuilder)]
pub struct [<$name_prefix Request>]<
'a,
W: $crate::WalletAnchor + 'a,
Expand All @@ -29,11 +29,9 @@ macro_rules! base_create_request_builder {
/// This is the wallet / payer that will always sign the transaction. It should implement [`wasm_client_anchor::WalletAnchor`] to allow for async signing via wallets.
pub wallet: &'a W,
/// Provide the args to the anchor program endpoint. This will be transformed into the instruction data when processing the transaction.
#[debug("args")]
#[builder(setter(into))]
pub args: ::$program::instruction::$name_prefix,
/// Provide the anchor accounts that will be used for the anchor instruction
#[debug("accounts")]
pub accounts: ::$program::accounts::$accounts,
/// Additional accounts which might be needed in a transfer hook / or in a future transaction when the transaction is saved on chain for a later date.
#[builder(default)]
Expand All @@ -49,7 +47,7 @@ macro_rules! base_create_request_builder {
pub extra_instructions: Vec<$crate::external::solana_sdk::instruction::Instruction>,
/// Options to be passed into the transaction being signed or sent.
#[builder(default)]
pub options: SolanaSignAndSendTransactionOptions,
pub options: $crate::external::wallet_standard::SolanaSignAndSendTransactionOptions,
}

impl<'a, W: $crate::WalletAnchor + 'a> [<$name_prefix Request>]<'a, W> {}
Expand All @@ -58,7 +56,7 @@ macro_rules! base_create_request_builder {
impl<'a, W: $crate::WalletAnchor + 'a> $crate::AnchorRequestMethods<'a, W>
for [<$name_prefix Request>]<'a, W>
{
fn options(&self) -> SolanaSignAndSendTransactionOptions {
fn options(&self) -> $crate::external::wallet_standard::SolanaSignAndSendTransactionOptions {
self.options.clone()
}

Expand Down

0 comments on commit f9da644

Please sign in to comment.