Skip to content

feat: Add new Provider.viewGlobalContractCode method for retrieving global contract code#1796

Merged
gagdiez merged 2 commits into
pre-release/v7from
v7/introduce-method-to-query-global-contract-code
Jan 16, 2026
Merged

feat: Add new Provider.viewGlobalContractCode method for retrieving global contract code#1796
gagdiez merged 2 commits into
pre-release/v7from
v7/introduce-method-to-query-global-contract-code

Conversation

@denbite

@denbite denbite commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this changes code in a published package: I have run pnpm changeset to create a changeset JSON document appropriate for this change.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This PR adds a new Provider.viewGlobalContractCode method for retrieving global contract code using either a codeHash, or an accountId identifier.

Example usage:

provider.viewGlobalContractCode({
    identifier: { accountId: "global_contract.near" },
});
provider.viewGlobalContractCode({
    identifier: { codeHash: "J1arLz48fgXcGyCPVckFwLnewNH6j1uw79thsvwqGYTY" },
});

Test Plan

Related issues/PRs

Should be merged after #1795

@changeset-bot

changeset-bot Bot commented Jan 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c2601e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
near-api-js Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gagdiez gagdiez merged commit 03af0cb into pre-release/v7 Jan 16, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from NEW❗ to Shipped 🚀 in DevTools Jan 16, 2026
@gagdiez gagdiez deleted the v7/introduce-method-to-query-global-contract-code branch January 16, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Shipped 🚀

Development

Successfully merging this pull request may close these issues.

3 participants