metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

Any way to make the { payer } be a publicKey #478

Closed kevinfaveri closed 1 year ago

kevinfaveri commented 1 year ago

I found a workaround for this already, but my use case is the following: want to use the transaction builder to generate the txn on the BE and then send to the FE the partially signed txn so that the payer will be the public key on the FE.

Currently, transaction builder expects a payer of type Signer, as it does sign on itself. Would be cool to have a feature where you can just build the transaction, and then set the payer, but don't sign the transaction in advance inside the builder algorithm.

KartikSoneji commented 1 year ago

For now, I have been using this:

 let metaplex = Metaplex.make(connection)
      .use(walletAdapterIdentity({
        publicKey: new PublicKey("..."),
        signTransaction: async (tx) => tx
      }));
kevinfaveri commented 1 year ago

For now, I have been using this:

 let metaplex = Metaplex.make(connection)
      .use(walletAdapterIdentity({
        publicKey: new PublicKey("..."),
        signTransaction: async (tx) => tx
      }));

Yep. I have been doing the same. Thanks for sharing tho! Would be nice to have the library supporting this use case tho.

KartikSoneji commented 1 year ago

Actually, just found this https://metaplex-foundation.github.io/js/functions/js.guestIdentity.html

lorisleiva commented 1 year ago

Hi there, using a "noop" signer is expected here to ensure proper typing on the SDK.

I've taken that into consideration in the new JS Solana client framework I'm building by providing a createNoopSigner helper method.