Skip to content

Commit 70bdd6a

Browse files
authored
ts: Make Provider require publicKey instead of wallet in accounts resolver (#3613)
1 parent b8ee933 commit 70bdd6a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The minor version will be incremented upon a breaking change and the patch versi
1111
## [Unreleased]
1212

1313
### Features
14+
- ts: Make `Provider` require publicKey instead of wallet in accounts resolver ([#3613](https://github.com/coral-xyz/anchor/pull/3613))
1415

1516
### Fixes
1617

ts/packages/anchor/src/program/accounts-resolver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ export class AccountsResolver<IDL extends Idl> {
279279
if ((account.signer || account.address) && !this.get([...path, name])) {
280280
// Default signers to the provider
281281
if (account.signer) {
282-
if (!this._provider.wallet) {
282+
if (!this._provider.publicKey) {
283283
throw new Error(
284-
"This function requires the `Provider` interface implementor to have a `wallet` field."
284+
"This function requires the `Provider` interface implementor to have a `publicKey` field."
285285
);
286286
}
287-
this.set([...path, name], this._provider.wallet.publicKey);
287+
this.set([...path, name], this._provider.publicKey);
288288
}
289289

290290
// Set based on `address` field

0 commit comments

Comments
 (0)