Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts: Change the Program constructor's idl parameter type to any #3181

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading