diff --git a/main/reference/zoe-api/zoe.md b/main/reference/zoe-api/zoe.md index b7dedae38..30076a021 100644 --- a/main/reference/zoe-api/zoe.md +++ b/main/reference/zoe-api/zoe.md @@ -141,13 +141,17 @@ const invitation = await invitationIssuer.claim(untrustedInvitation); const invitationValue = await E(Zoe).getInvitationDetails(invitation); ``` -## E(Zoe).install(bundle) +## E(Zoe).install(bundle, bundleLabel?) - **bundle**: **SourceBundle** +- **bundleLabel**: string - Optional - Returns: **Promise<Installation>** -Takes bundled source code for a Zoe contract as an argument and installs the code on Zoe. -Returns a **Promise** for an **Installation** object. +Create an installation by safely evaluating the code and registering it with Zoe. Returns a **Promise** for an +**Installation** object. The _bundleLabel_ will be accessible on the Installation using +`E(anInstallation).getBundleLabel()`. + +`E(zoe).install()` is seldom used outside of test contexts. Consider using `E(zoe).installBundleID()` instead. ```js // bundleSource takes source code files and @@ -157,6 +161,21 @@ const bundle = await bundleSource(pathResolve(`./src/contract.js`)); const installationP = await E(Zoe).install(bundle); ``` +## E(Zoe).installBundleID(bundleId, bundleLabel?) + +- **bundleId**: **BundleId** +- **bundleLabel**: string - Optional +- Returns: **Promise<Installation>** + +Takes a bundleId for a Zoe contract (generated using a [builder +script](/guides/zoe/contract-walkthru#bundling-a-contract) as an argument and installs the code with Zoe. +Returns a **Promise** for an **Installation** object. The _bundleLabel_ will be accessible on the Installation using +`E(anInstallation).getBundleLabel()`. + +```js +const installationP = await E(Zoe).installBundleID(bundleId, bundleLabel); +``` + ## E(Zoe).getConfiguration() - Returns: **Promise<Object>** @@ -406,13 +425,6 @@ const paymentKeywordRecord = harden({ Asset: quatloosPayment }); [`zcf.makeInvitation(...)`](./zoe-contract-facet#zcf-makeinvitation-offerhandler-description-customdetails-proposalshape). Each contract can define the properties it supports and which are required. -## E(Zoe).installBundleID(bundleId) - -- bundleId: **BundleId** -- Returns: **Promise<Installation>** - -Reserved for future use. - ## E(Zoe).getBundleIDFromInstallation(installation) - **installation**: **Installation**