sol-wallet-adapter
sol-wallet-adapter copied to clipboard
Working example with Anchor SDK
Are there any working examples of integrating the @project-serum/anchor
library with this adapter or with the @solana/wallet-adapter
components?
There seems to be a misalignment in the type definitions for the interface of a wallet adapter/provider and can't get them to work together properly.
Are there any working examples of integrating the
@project-serum/anchor
library with this adapter or with the@solana/wallet-adapter
components?There seems to be a misalignment in the type definitions for the interface of a wallet adapter/provider and can't get them to work together properly.
I think this issue is in the wrong repo :).
But the anchor wallet has the following interface
export interface Wallet {
signTransaction(tx: Transaction): Promise<Transaction>;
signAllTransactions(txs: Transaction[]): Promise<Transaction[]>;
publicKey: PublicKey;
}
So you can just make a new class that implements it and wraps your adapter. An adapter for the adapter.
@armaniferrante but the @solana/wallet-adapter
package includes classes that do the exact same thing, there's just a tiny typing conflict between them but aim to accomplish the same thing.
I'm trying to avoid writing my own adapter implementations for the wallet we want to support and use the ones that the Solana Labs team has already built and bundled with their library.