You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whose `source` property indicates a specific type defining how to get the
156
+
invitation. Supposing `spec` is an `InvitationSpec`, its `.source` is one of:
154
157
155
-
-`purse` - to make an offer with an invitation that is already in the Invitation purse of the smart wallet and agrees with `spec`on `.instance` and `.description` properties. For example, in [dapp-econ-gov](https://github.com/Agoric/dapp-econ-gov), committee members use invitations sent to them when the committee was created.
158
+
-`purse` - to use an invitation that is already in the Invitation purse of the smart wallet. `spec`includes properties `.instance` and `.description` properties that must correspond with the same properties of that matching Invitation. For example, in [dapp-econ-gov](https://github.com/Agoric/dapp-econ-gov), committee members use invitations sent to them when the committee was created.
156
159
157
-
-`contract` - the smart wallet makes an invitation by calling a method on the public facet of a specified instance: `E(E(zoe).getPublicFacet(spec.instance)[spec.publicInvitationMaker](...spec.invitationArgs)`
160
+
-`contract` - to have the smart wallet make an invitation using the public facet of a contract referenced by property `.instance`. Property `.publicInvitationMaker` specifies the method name, and optional property `.invitationArgs` specifies arguments for the invocation: `E(E(zoe).getPublicFacet(spec.instance)[spec.publicInvitationMaker](...spec.invitationArgs)`
161
+
162
+
-`agoricContract` - to have the smart wallet make an invitation using a chain of calls starting from an instance in [agoricNames](/guides/integration/name-services.html#agoricnames-agoricnamesadmin-well-known-names). Property `.instancePath` is an array of strings used to look up the starting point, and property `.callPipe` is an array of `[methodName: string, args?: unknown[]]` entries, each specifying a method call to invoke on the preceding result. The end of the pipe is expected to return an Invitation. For example, this `InvitationSpec` from [dapp-inter](https://github.com/Agoric/dapp-inter) corresponds with something like `E(E(E(agoricNames).lookup('instance', 'VaultFactory')).getCollateralManager(toLock.brand)).makeVaultInvitation()`:
158
163
159
-
-`agoricContract` - for example, from [dapp-inter](https://github.com/Agoric/dapp-inter):
160
164
```js
161
165
{
162
166
source:'agoricContract',
@@ -167,17 +171,15 @@ Supposing `spec` is an `InvitationSpec`, its `.source` is one of:
167
171
],
168
172
}
169
173
```
170
-
The smart wallet finds the instance using `E(agoricNames).lookup('instance', ...spec.instancePath)` and makes a chain of calls specified by `spec.callPipe`. Each entry in the callPipe is a `[methodName, args?]` pair used to execute a call on the preceding result. The end of the pipe is expected to return an Invitation.
171
174
172
-
- <aname="source-continuing"></a>`continuing` - For example, `dapp-inter` uses the following `InvitationSpec`to adjust a vault:
175
+
- <aname="source-continuing"></a>`continuing` - to have the smart wallet make an invitation by invoking a method on the result of a previous `executeOffer` action. Property `.previousOffer` specifies the `id` associated with that past action, property `.invitationMakerName` specifies the method name, and optional property `.invitationArgs` specifies arguments for the invocation. For example, this `InvitationSpec`from [dapp-inter](https://github.com/Agoric/dapp-inter) for adjusting a vault corresponds with something like `E(offerResults.get(vaultOfferId)).AdjustBalances()`:
173
176
```js
174
177
{
175
178
source:'continuing',
176
179
previousOffer: vaultOfferId,
177
180
invitationMakerName:'AdjustBalances',
178
181
}
179
182
```
180
-
In this continuing offer, the smart wallet uses the `spec.previousOffer` id to look up the `.invitationMakers` property of the result of the previous offer. It uses `E(invitationMakers)[spec.invitationMakerName](...spec.invitationArgs)` to make an invitation.
0 commit comments