Skip to content

Commit

Permalink
ts: add missing types for conditional exports (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictwlee committed Jan 3, 2022
1 parent b3720a0 commit 6f4fe1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@ incremented for features.

### Fixes

* ts: Add type declarations for conditional `workspace` and `Wallet` exports ([#1137](https://github.com/project-serum/anchor/pull/1137)).
* ts: Change commitment message `recent` to `processed` and `max` to `finalized` ([#1128](https://github.com/project-serum/anchor/pull/1128))
* ts: fix `translateAddress` which currently leads to failing browser code. Now uses `PublicKey` constructor instead of prototype chain constructor name checking which doesn't work in the presence of code minifying/mangling([#1138](https://github.com/project-serum/anchor/pull/1138))
* lang: add missing check that verifies that account is ATA when using `init_if_needed` and init is not needed([#1221](https://github.com/project-serum/anchor/pull/1221))
Expand Down
3 changes: 3 additions & 0 deletions ts/src/index.ts
Expand Up @@ -18,6 +18,9 @@ export { Idl } from "./idl.js";
export * as utils from "./utils/index.js";
export * from "./program/index.js";

export declare const workspace: any;
export declare const Wallet: import("./nodewallet").default;

if (!isBrowser) {
exports.workspace = require("./workspace.js").default;
exports.Wallet = require("./nodewallet.js").default;
Expand Down

0 comments on commit 6f4fe1d

Please sign in to comment.