suideveloper
All questions
Packages

How do I find a package ID after publishing?

November 13, 2026

sui client publish prints the package ID under Object Changes → Published Objects as PackageID. The CLI also saves it to Published.toml in your package folder as published-at for the active network. If you no longer have either, look up the publish transaction by its digest, or read the package field of the package's UpgradeCap, which always points at the latest version.

From the publish output

Terminal
sui client publish

In the human-readable output, find the Published Objects block and copy its PackageID. To use it in a script, ask for JSON and filter with jq:

Terminal
sui client publish --json \
  | jq -r '.objectChanges[] | select(.type == "published") | .packageId'

The same output lists the UpgradeCap under Created Objects, with object type 0x2::package::UpgradeCap. Save that ID too.

From Published.toml

Since Sui CLI 1.63, publishing writes a Published.toml file next to Move.toml:

TOML
[published.testnet]
chain-id = "4c78adac"
published-at = "0x..."        # the current (latest) package ID
original-id = "0x..."         # the ID of version 1
version = 1
upgrade-capability = "0x..."

There is one section per network. published-at is the ID to call. original-id is the first version's ID, which is also the prefix of every type the first version defined. Packages published with sui client test-publish (localnet, devnet) go to Pub.<env>.toml instead.

From the transaction digest

Every publish has a digest. Look it up with the CLI:

Terminal
sui client tx-block <DIGEST>

From TypeScript (@mysten/sui v2), the package appears in the effects as a changed object whose outputState is PackageWrite:

TypeScript
import { SuiGrpcClient } from '@mysten/sui/grpc'

const client = new SuiGrpcClient({
  network: 'testnet',
  baseUrl: 'https://fullnode.testnet.sui.io:443',
})

const result = await client.getTransaction({ digest, include: { effects: true } })
const tx = result.Transaction ?? result.FailedTransaction
const pkg = tx.effects.changedObjects.find(
  (o) => o.outputState === 'PackageWrite' && o.idOperation === 'Created',
)
console.log(pkg?.objectId)

Pasting the digest into an explorer works too.

After upgrades

Each upgrade creates a new package object with a new ID, so a package that has been upgraded has several IDs:

  • The latest ID is the package field of the UpgradeCap (sui client object <UPGRADE_CAP_ID>) and published-at in Published.toml.
  • The original ID stays the same and is original-id.
  • To list every version, query GraphQL:
GraphQL
{
  packageVersions(address: "0x<ANY_VERSION_ID>") {
    nodes { address version }
  }
}

Send it to https://graphql.testnet.sui.io/graphql or the mainnet equivalent.

Gotchas

  • IDs are per network. A package published on testnet doesn't exist on mainnet. Check sui client active-env before you go looking.
  • Devnet and localnet get wiped, so IDs from there stop working after a reset.
  • Don't confuse the package ID with the cap or init objects. Only the entry under Published Objects is the package.

To call your package next, see calling a Move function from the CLI.

Sources

More on packages