-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* @import {Orchestrator, OrchestrationFlow} from '../types.js' | ||
* @import {Orchestrator, OrchestrationFlow, OrchestrationAccount, OrchestrationAccountI, StakingAccountActions} from '../types.js' | ||
* @import {ContinuingOfferResult, InvitationMakers} from '@agoric/smart-wallet/src/types.js'; | ||
* @import {NameHub} from '@agoric/vats'; | ||
*/ | ||
|
@@ -9,16 +9,39 @@ | |
* @param {Orchestrator} orch | ||
* @param {object} ctx | ||
* @param {ZCF} ctx.zcf | ||
Check failure on line 11 in packages/orchestration/src/examples/continuing-invitation.flows.js GitHub Actions / lint-rest
|
||
* @param {any} ctx.flows | ||
* @param {ZCFSeat} _seat | ||
* @param {{ chainName: string }} offerArgs | ||
* @returns {Promise<ContinuingOfferResult>} | ||
*/ | ||
export const makeAccount = async (orch, ctx, _seat, { chainName }) => { | ||
export const makeAccount = async (orch, { flows }, _seat, { chainName }) => { | ||
const chain = await orch.getChain(chainName); | ||
const account = await chain.makeAccount(); | ||
|
||
/** @type {ContinuingOfferResult} */ | ||
const result = await account.asContinuingOffer(); | ||
|
||
// TODO merge in another invitationMaker that uses flow.undelegateAndTransfer | ||
|
||
// XXX can we call another flow? | ||
await flows.undelegateAndTransfer(orch, {}, undefined, { account }); | ||
|
||
return result; | ||
}; | ||
harden(makeAccount); | ||
|
||
// FIXME 'account' not Passable? | ||
/** | ||
* @satisfies {OrchestrationFlow} | ||
* @param {Orchestrator} orch | ||
* @param {object} ctx | ||
* @param {ZCFSeat | undefined} _seat | ||
* @param {{ account: OrchestrationAccountI & StakingAccountActions }} args | ||
* @returns {Promise<void>} | ||
*/ | ||
export const undelegateAndTransfer = async (orch, ctx, _seat, { account }) => { | ||
// FIXME undelegate something | ||
await account.undelegate([]); | ||
// FIXME then transfer something | ||
}; | ||
harden(undelegateAndTransfer); |