Browse Source

ts: Make `Provider` require publicKey instead of wallet in accounts resolver (#3613)

Davit Badalyan 6 months ago
parent
commit
70bdd6a8cb
2 changed files with 4 additions and 3 deletions
  1. 1 0
      CHANGELOG.md
  2. 3 3
      ts/packages/anchor/src/program/accounts-resolver.ts

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 ## [Unreleased]
 ## [Unreleased]
 
 
 ### Features
 ### Features
+ - ts: Make `Provider` require publicKey instead of wallet in accounts resolver ([#3613](https://github.com/coral-xyz/anchor/pull/3613))
 
 
 ### Fixes
 ### Fixes
 
 

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

@@ -279,12 +279,12 @@ export class AccountsResolver<IDL extends Idl> {
         if ((account.signer || account.address) && !this.get([...path, name])) {
         if ((account.signer || account.address) && !this.get([...path, name])) {
           // Default signers to the provider
           // Default signers to the provider
           if (account.signer) {
           if (account.signer) {
-            if (!this._provider.wallet) {
+            if (!this._provider.publicKey) {
               throw new Error(
               throw new Error(
-                "This function requires the `Provider` interface implementor to have a `wallet` field."
+                "This function requires the `Provider` interface implementor to have a `publicKey` field."
               );
               );
             }
             }
-            this.set([...path, name], this._provider.wallet.publicKey);
+            this.set([...path, name], this._provider.publicKey);
           }
           }
 
 
           // Set based on `address` field
           // Set based on `address` field