Skip to content

Commit

Permalink
ts: Change the Program constructor's idl parameter type to any (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Aug 19, 2024
1 parent eff7e45 commit 04b2153
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- lang, ts: Remove "8 byte" requirement from discriminator error messages ([#3161](https://github.com/coral-xyz/anchor/pull/3161)).
- lang: Remove `discriminator` method from `Discriminator` trait ([#3163](https://github.com/coral-xyz/anchor/pull/3163)).
- docker: Upgrade `node` to 20.16.0 LTS ([#3179](https://github.com/coral-xyz/anchor/pull/3179)).
- ts: Change the `Program` constructor's `idl` parameter type to `any` ([#3181](https://github.com/coral-xyz/anchor/pull/3181)).

## [0.30.1] - 2024-06-20

Expand Down
10 changes: 4 additions & 6 deletions ts/packages/anchor/src/program/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,27 +279,25 @@ export class Program<IDL extends Idl = Idl> {
* public keys of missing accounts when building instructions
*/
public constructor(
idl: IDL,
idl: any,
provider: Provider = getProvider(),
coder?: Coder,
getCustomResolver?: (
instruction: IdlInstruction
) => CustomAccountResolver<IDL> | undefined
) {
const camelCasedIdl = convertIdlToCamelCase(idl);

// Fields.
this._idl = camelCasedIdl;
this._idl = convertIdlToCamelCase(idl);
this._rawIdl = idl;
this._provider = provider;
this._programId = translateAddress(idl.address);
this._coder = coder ?? new BorshCoder(camelCasedIdl);
this._coder = coder ?? new BorshCoder(this._idl);
this._events = new EventManager(this._programId, provider, this._coder);

// Dynamic namespaces.
const [rpc, instruction, transaction, account, simulate, methods, views] =
NamespaceFactory.build(
camelCasedIdl,
this._idl,
this._coder,
this._programId,
provider,
Expand Down

0 comments on commit 04b2153

Please sign in to comment.