Interact with your deployed extension contracts from TypeScript.
- World contracts deployed and configured (see setup-world), or you're building on an existing world — building-on-existing-world guide (coming soon)
- In both cases:
deployments/andtest-resources.jsonfor that world copied to this repo's root - Your extension package published (e.g.
smart_gate_extension)
# From repo root
cp .env.example .env # fill in keys, WORLD_PACKAGE_ID, BUILDER_PACKAGE_ID
pnpm installSet WORLD_PACKAGE_ID, BUILDER_PACKAGE_ID, and other environment variables in .env from your extension package deployment output.
For the Smart Gate example script order, see smart_gate_extension/readme.md.
- Edit
test-resources.jsonto change item IDs, type IDs, or location hash - Object IDs are derived at runtime from
test-resources.json+extracted-object-ids.jsonusingderiveObjectId()
Use the existing scripts as templates. The key utilities:
utils/helper.ts— env config, context initialization, world config hydrationutils/derive-object-id.ts— derive Sui object IDs from game item IDsutils/proof.ts— generate location proofs for proximity verificationhelpers/— query OwnerCap objects for gates, storage units, characters