Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wallet publickey to Provider #1845

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ts/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {

export default interface Provider {
readonly connection: Connection;
readonly publicKey: PublicKey;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a Changelog entry and good to go


send?(
tx: Transaction,
Expand Down Expand Up @@ -48,6 +49,8 @@ export default interface Provider {
* by the provider.
*/
export class AnchorProvider implements Provider {
readonly publicKey: PublicKey;

/**
* @param connection The cluster connection where the program is deployed.
* @param wallet The wallet used to pay for and sign all transactions.
Expand All @@ -57,7 +60,9 @@ export class AnchorProvider implements Provider {
readonly connection: Connection,
readonly wallet: Wallet,
readonly opts: ConfirmOptions
) {}
) {
this.publicKey = wallet.publicKey;
}

static defaultOptions(): ConfirmOptions {
return {
Expand Down