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

docs: update on zoe.installBundle and zoe.installBundleId #1265

Merged
merged 3 commits into from
Jan 22, 2025
Merged
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
32 changes: 22 additions & 10 deletions main/reference/zoe-api/zoe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>**
Expand Down Expand Up @@ -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**
Expand Down
Loading