From 27259880fea6fcde684b42f59ac5c431761c2158 Mon Sep 17 00:00:00 2001 From: Tommy Johnson Date: Wed, 27 Apr 2022 18:22:43 -0400 Subject: [PATCH 1/3] add wallet publickey to Provider --- ts/src/provider.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/src/provider.ts b/ts/src/provider.ts index ed499720e6..a087c36a80 100644 --- a/ts/src/provider.ts +++ b/ts/src/provider.ts @@ -20,6 +20,7 @@ import { export default interface Provider { readonly connection: Connection; + readonly publicKey: PublicKey; send?( tx: Transaction, @@ -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. @@ -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 { From c3d5f024a073b1385c7ef7e6e7a0651ea36217d6 Mon Sep 17 00:00:00 2001 From: Tommy Johnson Date: Thu, 28 Apr 2022 13:25:05 -0400 Subject: [PATCH 2/3] run prettier --- ts/src/provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/src/provider.ts b/ts/src/provider.ts index a087c36a80..c7b40cd14e 100644 --- a/ts/src/provider.ts +++ b/ts/src/provider.ts @@ -50,7 +50,7 @@ export default interface 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. From 2a58f2ae60870730f7f9b9bf9d47bb16be6d73a4 Mon Sep 17 00:00:00 2001 From: Tommy Johnson Date: Thu, 28 Apr 2022 15:45:37 -0400 Subject: [PATCH 3/3] add TS change log info --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b34138d0..3828629312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The minor version will be incremented upon a breaking change and the patch versi * cli: Move `overflow-checks` into workspace `Cargo.toml` so that it will not be ignored by compiler ([#1806](https://github.com/project-serum/anchor/pull/1806)). * lang: Fix missing account name information when deserialization fails when using `init` or `zero` ([#1800](https://github.com/project-serum/anchor/pull/1800)). +* ts: Expose the wallet's publickey on the Provider ([#1845](https://github.com/project-serum/anchor/pull/1845)). ## [0.24.2] - 2022-04-13