@agoric/inter-protocol 0.17.0-u20.0 → 0.17.0-u21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/package.json +23 -22
  2. package/src/auction/auctioneer.d.ts +1 -1
  3. package/src/auction/auctioneer.d.ts.map +1 -1
  4. package/src/auction/auctioneer.js +1 -1
  5. package/src/auction/offerBook.d.ts.map +1 -1
  6. package/src/auction/offerBook.js +1 -0
  7. package/src/auction/params.d.ts +1 -0
  8. package/src/auction/params.d.ts.map +1 -1
  9. package/src/auction/params.js +1 -0
  10. package/src/auction/scheduler.d.ts +1 -1
  11. package/src/auction/util.d.ts +1 -1
  12. package/src/auction/util.d.ts.map +1 -1
  13. package/src/feeDistributor.d.ts +17 -17
  14. package/src/price/fluxAggregatorContract.d.ts +2 -2
  15. package/src/price/fluxAggregatorContract.d.ts.map +1 -1
  16. package/src/price/fluxAggregatorKit.d.ts +1 -1
  17. package/src/price/roundsManager.d.ts +1 -1
  18. package/src/proposals/econ-behaviors.js +10 -1
  19. package/src/provisionPool.d.ts +3 -3
  20. package/src/provisionPool.d.ts.map +1 -1
  21. package/src/provisionPool.js +11 -9
  22. package/src/provisionPoolKit.d.ts +2 -2
  23. package/src/provisionPoolKit.d.ts.map +1 -1
  24. package/src/provisionPoolKit.js +93 -45
  25. package/src/psm/psm.d.ts +1 -1
  26. package/src/psm/psm.d.ts.map +1 -1
  27. package/src/reserve/assetReserve.d.ts +7 -0
  28. package/src/reserve/assetReserve.d.ts.map +1 -1
  29. package/src/reserve/assetReserve.js +3 -0
  30. package/src/reserve/assetReserveKit.d.ts +27 -0
  31. package/src/reserve/assetReserveKit.d.ts.map +1 -1
  32. package/src/reserve/assetReserveKit.js +108 -2
  33. package/src/vaultFactory/liquidation.d.ts +2 -0
  34. package/src/vaultFactory/liquidation.d.ts.map +1 -1
  35. package/src/vaultFactory/liquidation.js +5 -5
  36. package/src/vaultFactory/orderedVaultStore.d.ts +1 -0
  37. package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
  38. package/src/vaultFactory/orderedVaultStore.js +4 -2
  39. package/src/vaultFactory/params.d.ts +4 -1
  40. package/src/vaultFactory/params.d.ts.map +1 -1
  41. package/src/vaultFactory/params.js +4 -1
  42. package/src/vaultFactory/prioritizedVaults.d.ts +4 -3
  43. package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -1
  44. package/src/vaultFactory/prioritizedVaults.js +5 -2
  45. package/src/vaultFactory/storeUtils.d.ts +2 -2
  46. package/src/vaultFactory/storeUtils.d.ts.map +1 -1
  47. package/src/vaultFactory/vaultDirector.d.ts +43 -44
  48. package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
  49. package/src/vaultFactory/vaultDirector.js +2 -1
  50. package/src/vaultFactory/vaultFactory.d.ts +6 -6
  51. package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
  52. package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
  53. package/src/vaultFactory/vaultManager.d.ts +2 -0
  54. package/src/vaultFactory/vaultManager.d.ts.map +1 -1
  55. package/src/vaultFactory/vaultManager.js +3 -2
@@ -15,6 +15,7 @@ import {
15
15
  makeScalarBigMapStore,
16
16
  makeScalarBigSetStore,
17
17
  } from '@agoric/vat-data';
18
+ import { makeAtomicProvider, makeScalarMapStore } from '@agoric/store';
18
19
  import { PowerFlags } from '@agoric/vats/src/walletFlags.js';
19
20
  import {
20
21
  PublicTopicShape,
@@ -149,6 +150,20 @@ export const prepareProvisionPoolKit = (
149
150
  { makeRecorderKit, params, poolBank, zcf, makeBridgeProvisionTool },
150
151
  ) => {
151
152
  const zoe = zcf.getZoeService();
153
+ const ephemeralPurses = makeScalarMapStore('fundingPurseForBrand');
154
+ const purseProvider = makeAtomicProvider(ephemeralPurses);
155
+ const getFundingPurseForBrand = async poolBrand => {
156
+ await null;
157
+ try {
158
+ const purse = await purseProvider.provideAsync(poolBrand, brand =>
159
+ E(poolBank).getPurse(brand),
160
+ );
161
+ return purse;
162
+ } catch (err) {
163
+ trace(`🚨 could not get purse for brand ${poolBrand}`, err);
164
+ throw err;
165
+ }
166
+ };
152
167
 
153
168
  const makeProvisionPoolKitInternal = zone.exoClassKit(
154
169
  'ProvisionPoolKit',
@@ -180,7 +195,7 @@ export const prepareProvisionPoolKit = (
180
195
  },
181
196
  /**
182
197
  * @param {object} opts
183
- * @param {Purse<'nat'>} opts.fundPurse
198
+ * @param {Purse<'nat'>} [opts.fundPurse]
184
199
  * @param {Brand<'nat'>} opts.poolBrand
185
200
  * @param {StorageNode} opts.metricsNode
186
201
  */
@@ -335,35 +350,43 @@ export const prepareProvisionPoolKit = (
335
350
  );
336
351
  facets.helper.publishMetrics();
337
352
  },
353
+ /**
354
+ * @param {Amount} amount
355
+ * @param {ERef<Purse>} srcPurse
356
+ */
357
+ async onPoolDeposit(amount, srcPurse) {
358
+ const { helper } = this.facets;
359
+ const { brandToPSM, poolBrand } = this.state;
360
+
361
+ const { brand } = amount;
362
+ if (AmountMath.isEmpty(amount) || brand === poolBrand) {
363
+ return;
364
+ }
365
+
366
+ // `amount` doesn't match the current `poolBrand`, so we need to swap
367
+ // it.
368
+ if (!brandToPSM.has(brand)) {
369
+ console.error('funds arrived but no PSM instance', brand);
370
+ return;
371
+ }
372
+ const instance = brandToPSM.get(brand);
373
+ const payment = E(srcPurse).withdraw(amount);
374
+ await helper.swap(payment, amount, instance).catch(async reason => {
375
+ console.error(X`swap failed: ${reason}`);
376
+ const resolvedPayment = await payment;
377
+ return E(srcPurse).deposit(resolvedPayment);
378
+ });
379
+ },
338
380
  /**
339
381
  * @param {ERef<Purse>} exchangePurse
340
382
  * @param {ERef<Brand>} brand
341
383
  */
342
384
  watchCurrentAmount(exchangePurse, brand) {
343
- const {
344
- state: { brandToPSM, poolBrand },
345
- facets: { helper },
346
- } = this;
347
-
385
+ const { helper } = this.facets;
348
386
  void observeNotifier(E(exchangePurse).getCurrentAmountNotifier(), {
349
387
  updateState: async amount => {
350
388
  trace('provisionPool balance update', amount);
351
- if (AmountMath.isEmpty(amount) || amount.brand === poolBrand) {
352
- return;
353
- }
354
- if (!brandToPSM.has(brand)) {
355
- console.error('funds arrived but no PSM instance', brand);
356
- return;
357
- }
358
- const instance = brandToPSM.get(brand);
359
- const payment = E(exchangePurse).withdraw(amount);
360
- await helper
361
- .swap(payment, amount, instance)
362
- .catch(async reason => {
363
- console.error(X`swap failed: ${reason}`);
364
- const resolvedPayment = await payment;
365
- return E(exchangePurse).deposit(resolvedPayment);
366
- });
389
+ await helper.onPoolDeposit(amount, exchangePurse);
367
390
  },
368
391
  fail: reason => {
369
392
  if (isUpgradeDisconnection(reason)) {
@@ -429,40 +452,50 @@ export const prepareProvisionPoolKit = (
429
452
  );
430
453
  },
431
454
  /**
455
+ * @param {Brand<'nat'>} poolBrand
432
456
  * @param {object} [options]
433
457
  * @param {MetricsNotification} [options.metrics]
434
458
  */
435
- start({ metrics } = {}) {
436
- const {
437
- state: { poolBrand },
438
- facets: { helper },
439
- } = this;
459
+ start(poolBrand, { metrics } = {}) {
460
+ const { facets, state } = this;
461
+ const { helper } = facets;
462
+ const lastPoolBrand = state.poolBrand;
440
463
 
441
- // Must match. poolBrand is from durable state and the param is from
442
- // the contract, so it technically can change between incarnations.
443
- // That would be a severe bug.
464
+ // The PerAccountInitialAmount param must use the correct brand for
465
+ // this incarnation.
444
466
  AmountMath.coerce(poolBrand, params.getPerAccountInitialAmount());
445
467
 
446
- void helper.watchAssetSubscription();
447
-
468
+ // Restore old metrics.
448
469
  if (metrics) {
449
- // Restore state.
450
- // we publishMetrics() below
451
470
  const {
452
471
  walletsProvisioned,
453
472
  totalMintedProvided,
454
473
  totalMintedConverted,
455
474
  } = metrics;
456
475
  assert.typeof(walletsProvisioned, 'bigint');
457
- AmountMath.coerce(poolBrand, totalMintedProvided);
458
- AmountMath.coerce(poolBrand, totalMintedConverted);
459
- Object.assign(this.state, {
476
+ AmountMath.coerce(lastPoolBrand, totalMintedProvided);
477
+ AmountMath.coerce(lastPoolBrand, totalMintedConverted);
478
+ Object.assign(state, {
460
479
  walletsProvisioned,
461
480
  totalMintedProvided,
462
481
  totalMintedConverted,
463
482
  });
464
483
  helper.publishMetrics();
465
484
  }
485
+
486
+ // Update as needed when `poolBrand` changes.
487
+ if (poolBrand !== lastPoolBrand) {
488
+ state.poolBrand = poolBrand;
489
+ state.fundPurse = undefined;
490
+ void getFundingPurseForBrand(poolBrand).then(purse =>
491
+ helper.updateFundPurse(purse, poolBrand),
492
+ );
493
+ state.totalMintedProvided = AmountMath.makeEmpty(poolBrand);
494
+ state.totalMintedConverted = AmountMath.makeEmpty(poolBrand);
495
+ helper.publishMetrics();
496
+ }
497
+
498
+ void helper.watchAssetSubscription();
466
499
  },
467
500
  /**
468
501
  * @param {ERef<Payment>} payIn
@@ -470,10 +503,13 @@ export const prepareProvisionPoolKit = (
470
503
  * @param {PsmInstance} instance
471
504
  */
472
505
  async swap(payIn, amount, instance) {
506
+ await null;
507
+ const { facets, state } = this;
508
+ const { helper } = facets;
473
509
  const {
474
- facets: { helper },
475
- state: { fundPurse },
476
- } = this;
510
+ poolBrand,
511
+ fundPurse = await getFundingPurseForBrand(poolBrand),
512
+ } = state;
477
513
  const psmPub = E(zoe).getPublicFacet(instance);
478
514
  const proposal = harden({ give: { In: amount } });
479
515
  const invitation = E(psmPub).makeWantMintedInvitation();
@@ -483,19 +519,31 @@ export const prepareProvisionPoolKit = (
483
519
  helper.onTrade(rxd);
484
520
  return rxd;
485
521
  },
522
+ /**
523
+ * @param {Purse<'nat'>} purse
524
+ * @param {Brand<'nat'>} brand
525
+ */
526
+ updateFundPurse(purse, brand) {
527
+ const { state } = this;
528
+ if (brand !== state.poolBrand || state.fundPurse) return;
529
+ state.fundPurse = purse;
530
+ },
486
531
  },
487
532
  forHandler: {
488
533
  onProvisioned() {
489
- const { state, facets } = this;
534
+ const { facets, state } = this;
490
535
  state.walletsProvisioned += 1n;
491
536
  facets.helper.publishMetrics();
492
537
  },
493
538
  /** @param {ERef<Bank>} destBank */
494
539
  async sendInitialPayment(destBank) {
540
+ await null;
541
+ const { facets, state } = this;
542
+ const { helper } = facets;
495
543
  const {
496
- facets: { helper },
497
- state: { fundPurse, poolBrand },
498
- } = this;
544
+ poolBrand,
545
+ fundPurse = await getFundingPurseForBrand(poolBrand),
546
+ } = state;
499
547
  const perAccountInitialAmount = /** @type {Amount<'nat'>} */ (
500
548
  params.getPerAccountInitialAmount()
501
549
  );
@@ -545,7 +593,7 @@ export const prepareProvisionPoolKit = (
545
593
  * @returns {Promise<ProvisionPoolKit>}
546
594
  */
547
595
  const makeProvisionPoolKit = async ({ poolBrand, storageNode }) => {
548
- const fundPurse = await E(poolBank).getPurse(poolBrand);
596
+ const fundPurse = await getFundingPurseForBrand(poolBrand);
549
597
  const metricsNode = await E(storageNode).makeChildNode('metrics');
550
598
 
551
599
  return makeProvisionPoolKitInternal({
package/src/psm/psm.d.ts CHANGED
@@ -51,7 +51,7 @@ export function start(zcf: ZCF<GovernanceTerms<{
51
51
  } & {
52
52
  Electorate: "invitation";
53
53
  }>;
54
- } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
54
+ } & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
55
55
  get: () => import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
56
56
  GiveMintedFee: "ratio";
57
57
  MintLimit: "amount";
@@ -1 +1 @@
1
- {"version":3,"file":"psm.d.ts","sourceRoot":"","sources":["psm.js"],"names":[],"mappings":"AAqCA;;;;;;GAMG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAkCrB;AAsBK,2BAlBI,GAAG,CACT,eAAe,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,QAAQ,CAAC;C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkUjB;;;;;;;;;;uBAzYa,MAAM,CAAC,KAAK,CAAC;;;;;uBAEb,MAAM,CAAC,KAAK,CAAC;;;;;oBAEb,MAAM,CAAC,KAAK,CAAC;;;;;yBAEb,MAAM,CAAC,KAAK,CAAC;;;;;yBAEb,MAAM,CAAC,KAAK,CAAC;;6BAoYb,QAAQ,OAAO,KAAK,CAAb,CAAe,aAAa,CAAC;kCAlZU,aAAa;mCAAb,aAAa;6BAoB/C,kBAAkB;kCApBgB,aAAa;6BAD/C,WAAW"}
@@ -16,6 +16,11 @@ export function start(zcf: ZCF<GovernanceTerms<{}> & {
16
16
  increaseLiquidationShortfall(shortfall: Amount<"nat">): void;
17
17
  reduceLiquidationShortfall(reduction: Amount<"nat">): void;
18
18
  }>, undefined>>;
19
+ makeSingleWithdrawalInvitation(): Promise<globalThis.Invitation<any, undefined>>;
20
+ makeRepeatableWithdrawalInvitation(): Promise<globalThis.Invitation<{
21
+ invitationMakers: Partial<any>;
22
+ }, undefined>>;
23
+ revokeOutstandingWithdrawalInvitations(): void;
19
24
  }>>;
20
25
  /** @type {GovernedPublicFacet<typeof assetReserveKit.public>} */
21
26
  publicFacet: GovernedPublicFacet<import("@endo/exo").Guarded<{
@@ -43,9 +48,11 @@ export type AssetReservePublicFacet = EReturn<typeof start>["publicFacet"];
43
48
  * the creator facet for the governor
44
49
  */
45
50
  export type AssetReserveCreatorFacet = EReturn<typeof start>["creatorFacet"];
51
+ export type ReserveContract = ContractOf<typeof start>;
46
52
  import type { ContractMeta } from '@agoric/zoe';
47
53
  import type { FeeMintAccess } from '@agoric/zoe';
48
54
  import type { Baggage } from '@agoric/vat-data';
49
55
  import type { Allocation } from '@agoric/zoe';
50
56
  import type { EReturn } from '@endo/far';
57
+ import type { ContractOf } from '@agoric/zoe/src/zoeService/utils.js';
51
58
  //# sourceMappingURL=assetReserve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assetReserve.d.ts","sourceRoot":"","sources":["assetReserve.js"],"names":[],"mappings":"AAiBA,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAGnC;AAgCK,2BAbI,GAAG,CACT,eAAe,CAAC,EAAE,CAAC,GAAG;IACpB,YAAY,EAAE,CAAC,2BAA2B,CAAC,CAAC;CAC7C,CACF,eACO;IACN,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;CAChC,WACO,OAAO;IAoDd,mEAAmE;kBAAxD,oBAAoB;;;;;;;OAAgC;IAE/D,iEAAiE;iBAAtD,mBAAmB;;;;;OAA+B;GAKhE;sCArFY;IACR,4BAA4B,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,0BAA0B,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;;kCAuFU,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;gCAC3B,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;;;eAK3B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;oBACrC,MAAM,UAAU;sCAChB,MAAM,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;;sCAG5C,QAAQ,OAAO,KAAK,CAAb,CAAe,aAAa,CAAC;;;;uCAErC,QAAQ,OAAO,KAAK,CAAb,CAAe,cAAc,CAAC;kCAnHsB,aAAa;mCAAb,aAAa;6BAkB1D,kBAAkB;gCAlB2B,aAAa;6BAD3D,WAAW"}
1
+ {"version":3,"file":"assetReserve.d.ts","sourceRoot":"","sources":["assetReserve.js"],"names":[],"mappings":"AAkBA,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAGnC;AAgCK,2BAbI,GAAG,CACT,eAAe,CAAC,EAAE,CAAC,GAAG;IACpB,YAAY,EAAE,CAAC,2BAA2B,CAAC,CAAC;CAC7C,CACF,eACO;IACN,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;CAChC,WACO,OAAO;IAoDd,mEAAmE;kBAAxD,oBAAoB;;;;;;;;;;;;OAAgC;IAE/D,iEAAiE;iBAAtD,mBAAmB;;;;;OAA+B;GAKhE;sCArFY;IACR,4BAA4B,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,0BAA0B,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;;kCAuFU,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;gCAC3B,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;;;eAK3B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;oBACrC,MAAM,UAAU;sCAChB,MAAM,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;;sCAG5C,QAAQ,OAAO,KAAK,CAAb,CAAe,aAAa,CAAC;;;;uCAErC,QAAQ,OAAO,KAAK,CAAb,CAAe,cAAc,CAAC;8BAIpC,WAAW,OAAO,KAAK,CAAC;kCAvHkC,aAAa;mCAAb,aAAa;6BAkB1D,kBAAkB;gCAlB2B,aAAa;6BAF3D,WAAW;gCACR,qCAAqC"}
@@ -10,6 +10,7 @@ import { prepareAssetReserveKit } from './assetReserveKit.js';
10
10
 
11
11
  /**
12
12
  * @import {EReturn} from '@endo/far';
13
+ * @import {ContractOf} from '@agoric/zoe/src/zoeService/utils.js';
13
14
  * @import {Allocation, ContractMeta, FeeMintAccess, Installation} from '@agoric/zoe';
14
15
  */
15
16
 
@@ -128,3 +129,5 @@ harden(start);
128
129
  * @typedef {EReturn<typeof start>['creatorFacet']} AssetReserveCreatorFacet
129
130
  * the creator facet for the governor
130
131
  */
132
+
133
+ /** @typedef {ContractOf<typeof start>} ReserveContract */
@@ -21,6 +21,20 @@ export function prepareAssetReserveKit(baggage: import("@agoric/vat-data").Bagga
21
21
  */
22
22
  burnFeesToReduceShortfall(reduction: Amount<"nat">): void;
23
23
  };
24
+ withdrawalHandler: {
25
+ handle(seat: any): Promise<string>;
26
+ };
27
+ withdrawalFacet: {
28
+ Withdraw(): Promise<globalThis.Invitation<any, undefined>>;
29
+ };
30
+ repeatableWithdrawalHandler: {
31
+ /**
32
+ * @param {ZCFSeat} seat
33
+ */
34
+ handle(seat: ZCFSeat): {
35
+ invitationMakers: Partial<any>;
36
+ };
37
+ };
24
38
  machine: {
25
39
  /**
26
40
  * @param {Issuer} issuer
@@ -35,6 +49,11 @@ export function prepareAssetReserveKit(baggage: import("@agoric/vat-data").Bagga
35
49
  /** @param {Amount<'nat'>} reduction */
36
50
  reduceLiquidationShortfall(reduction: Amount<"nat">): void;
37
51
  }>, undefined>>;
52
+ makeSingleWithdrawalInvitation(): Promise<globalThis.Invitation<any, undefined>>;
53
+ makeRepeatableWithdrawalInvitation(): Promise<globalThis.Invitation<{
54
+ invitationMakers: Partial<any>;
55
+ }, undefined>>;
56
+ revokeOutstandingWithdrawalInvitations(): void;
38
57
  };
39
58
  /**
40
59
  * XXX missing governance public methods
@@ -72,5 +91,13 @@ export type MetricsNotification = {
72
91
  };
73
92
  export type AssetReserveKit = EReturn<EReturn<typeof prepareAssetReserveKit>>;
74
93
  import type { ZCFMint } from '@agoric/zoe';
94
+ import type { StorageNode } from '@agoric/internal/src/lib-chainStorage.js';
95
+ import type { ZCF } from '@agoric/zoe';
96
+ import type { Brand } from '@agoric/ertp';
97
+ import type { Keyword } from '@agoric/zoe';
98
+ import type { Amount } from '@agoric/ertp';
99
+ import type { ZCFSeat } from '@agoric/zoe';
100
+ import type { Issuer } from '@agoric/ertp';
101
+ import type { AmountKeywordRecord } from '@agoric/zoe/src/zoeService/types.js';
75
102
  import type { EReturn } from '@endo/far';
76
103
  //# sourceMappingURL=assetReserveKit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assetReserveKit.d.ts","sourceRoot":"","sources":["assetReserveKit.js"],"names":[],"mappings":"AAuCO,gDARI,OAAO,kBAAkB,EAAE,OAAO,kDAClC;IACN,OAAO,EAAE,QAAQ,KAAK,CAAC,CAAC;IACxB,eAAe,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;IACvF,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,GAAG,CAAC;CACV;;QAoEI,2BAA2B;kCAAf,KAAK;QAUjB;;;WAGG;gCAFQ,KAAK,WACL,OAAO;;;;QAqBlB;;;WAGG;6CAFQ,MAAM,CAAC,KAAK,CAAC,GACX,IAAI;;;QA6BjB;;;WAGG;0BAFQ,MAAM,WACN,MAAM;QAmBjB,8DAA8D;;;YA2D9D,uCAAuC;oDAA3B,MAAM,CAAC,KAAK,CAAC;YAWzB,uCAAuC;kDAA3B,MAAM,CAAC,KAAK,CAAC;;;IArD3B;;;OAGG;;QAED,mDAAmD;;;;;;;QAqCnD,uCAAuC;gDAA3B,MAAM,CAAC,KAAK,CAAC;QAWzB,uCAAuC;8CAA3B,MAAM,CAAC,KAAK,CAAC;;KA8BhC;;iBA3Qa,mBAAmB;;;;;sBACnB,MAAM,CAAC,KAAK,CAAC;;;;oBAEb,MAAM,CAAC,KAAK,CAAC;;;;oBACb,MAAM,CAAC,KAAK,CAAC;;8BAyQb,QAAQ,QAAQ,OAAO,sBAAsB,CAAC,CAAC;6BAlRO,aAAa;6BAFvD,WAAW"}
1
+ {"version":3,"file":"assetReserveKit.d.ts","sourceRoot":"","sources":["assetReserveKit.js"],"names":[],"mappings":"AAiDO,gDARI,OAAO,kBAAkB,EAAE,OAAO,kDAClC;IACN,OAAO,EAAE,QAAQ,KAAK,CAAC,CAAC;IACxB,eAAe,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;IACvF,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,GAAG,CAAC;CACV;;QA8GI,2BAA2B;kCAAf,KAAK;QAUjB;;;WAGG;gCAFQ,KAAK,WACL,OAAO;;;;QAqBlB;;;WAGG;6CAFQ,OAAO,KAAK,CAAC,GACX,IAAI;;;;;;;;;QAsDjB;;WAEG;qBADQ,OAAO;;;;;QAYlB;;;WAGG;0BAFQ,MAAM,WACN,MAAM;QAmBjB,8DAA8D;;;YA2E9D,uCAAuC;oDAA3B,OAAO,KAAK,CAAC;YAWzB,uCAAuC;kDAA3B,OAAO,KAAK,CAAC;;;;;;;;IArD3B;;;OAGG;;QAED,mDAAmD;;;;;;;QAqCnD,uCAAuC;gDAA3B,OAAO,KAAK,CAAC;QAWzB,uCAAuC;8CAA3B,OAAO,KAAK,CAAC;;KA8BhC;;iBA3Wa,mBAAmB;;;;;sBACnB,OAAO,KAAK,CAAC;;;;oBAEb,OAAO,KAAK,CAAC;;;;oBACb,OAAO,KAAK,CAAC;;8BAyWb,QAAQ,QAAQ,OAAO,sBAAsB,CAAC,CAAC;6BAlXE,aAAa;iCAJ9C,0CAA0C;yBAIT,aAAa;2BAHpC,cAAc;6BAGS,aAAa;4BAHpC,cAAc;6BAGS,aAAa;4BAHpC,cAAc;yCAEhB,qCAAqC;6BALjD,WAAW"}
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  import { Fail, q } from '@endo/errors';
2
3
  import { AmountMath, AmountShape, IssuerShape } from '@agoric/ertp';
3
4
  import { makeTracer } from '@agoric/internal';
@@ -7,16 +8,25 @@ import {
7
8
  makeRecorderTopic,
8
9
  TopicsRecordShape,
9
10
  } from '@agoric/zoe/src/contractSupport/topics.js';
10
- import { AmountKeywordRecordShape } from '@agoric/zoe/src/typeGuards.js';
11
+ import {
12
+ AmountKeywordRecordShape,
13
+ OfferHandlerI,
14
+ } from '@agoric/zoe/src/typeGuards.js';
11
15
  import { E } from '@endo/eventual-send';
12
16
  import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js';
17
+ import { prepareRevocableMakerKit } from '@agoric/base-zone/zone-helpers.js';
18
+ import { makeDurableZone } from '@agoric/zone/durable.js';
13
19
 
14
20
  const trace = makeTracer('ReserveKit', true);
15
21
 
16
22
  /**
17
23
  * @import {EReturn} from '@endo/far';
18
24
  * @import {TypedPattern} from '@agoric/internal';
19
- * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe';
25
+ * @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
26
+ * @import {Amount, Brand, Issuer} from '@agoric/ertp';
27
+ * @import {MapStore, SetStore} from '@agoric/store';
28
+ * @import {AmountKeywordRecord} from '@agoric/zoe/src/zoeService/types.js';
29
+ * @import {ZCF, OfferHandler, Keyword, ZCFMint, ZCFSeat} from '@agoric/zoe';
20
30
  */
21
31
 
22
32
  /**
@@ -45,6 +55,40 @@ export const prepareAssetReserveKit = async (
45
55
  const feeKit = feeMint.getIssuerRecord();
46
56
  const emptyAmount = AmountMath.makeEmpty(feeKit.brand);
47
57
 
58
+ const zone = makeDurableZone(baggage);
59
+
60
+ // Durable revocation bookkeeping for the revocable single and repeatable
61
+ // invitations.
62
+ /** @type {SetStore<{ revoke: () => boolean }>} */
63
+ const outstandingRevokers = zone.setStore('outstandingRevokers');
64
+
65
+ const { makeRevocableKit: makeRevocableWithdrawalFacet } =
66
+ prepareRevocableMakerKit(zone, 'WithdrawalFacet', ['Withdraw']);
67
+
68
+ const { makeRevocableKit: makeRevocableWithdrawalHandler } =
69
+ prepareRevocableMakerKit(zone, 'WithdrawalHandler', ['handle'], {
70
+ extraMethods: {
71
+ /**
72
+ * Add some additional cleanup to avoid proliferation of revokers for
73
+ * spent invitations.
74
+ *
75
+ * @param {ZCFSeat} seat
76
+ * @param {never} offerArgs
77
+ */
78
+ handle(seat, offerArgs) {
79
+ const { revoker } = this.facets;
80
+ // We remove our outstanding revoker because we are consumed by Zoe
81
+ // and cannot be used again.
82
+ if (this.state.underlying === undefined) {
83
+ Fail`${q('WithdrawalHandler_caretaker')} revoked`;
84
+ }
85
+
86
+ outstandingRevokers.delete(revoker);
87
+ return this.state.underlying.handle(seat, offerArgs);
88
+ },
89
+ },
90
+ });
91
+
48
92
  const makeAssetReserveKitInternal = prepareExoClassKit(
49
93
  baggage,
50
94
  'AssetReserveKit',
@@ -53,10 +97,18 @@ export const prepareAssetReserveKit = async (
53
97
  governedApis: M.interface('AssetReserve governedApis', {
54
98
  burnFeesToReduceShortfall: M.call(AmountShape).returns(),
55
99
  }),
100
+ withdrawalFacet: M.interface('AssetReserve withdrawalFacet', {
101
+ Withdraw: M.call().returns(M.promise()),
102
+ }),
103
+ withdrawalHandler: OfferHandlerI,
104
+ repeatableWithdrawalHandler: OfferHandlerI,
56
105
  machine: M.interface('AssetReserve machine', {
57
106
  addIssuer: M.call(IssuerShape, M.string()).returns(M.promise()),
58
107
  getAllocations: M.call().returns(AmountKeywordRecordShape),
59
108
  makeShortfallReportingInvitation: M.call().returns(M.promise()),
109
+ makeSingleWithdrawalInvitation: M.call().returns(M.promise()),
110
+ makeRepeatableWithdrawalInvitation: M.call().returns(M.promise()),
111
+ revokeOutstandingWithdrawalInvitations: M.call().returns(),
60
112
  }),
61
113
  public: M.interface('AssetReserve public', {
62
114
  makeAddCollateralInvitation: M.call().returns(M.promise()),
@@ -165,6 +217,44 @@ export const prepareAssetReserveKit = async (
165
217
  facets.helper.writeMetrics();
166
218
  },
167
219
  },
220
+ withdrawalHandler: {
221
+ async handle(seat) {
222
+ const { collateralSeat } = this.state;
223
+ const { helper } = this.facets;
224
+ const { want } = seat.getProposal();
225
+
226
+ // COMMIT POINT
227
+ // UNTIL #10684: ability to terminate an incarnation w/o terminating the contract
228
+ zcf.atomicRearrange(harden([[collateralSeat, seat, want]]));
229
+
230
+ helper.writeMetrics();
231
+ seat.exit();
232
+
233
+ trace('withdrew collateral', want);
234
+ return 'withdrew Collateral from the Reserve';
235
+ },
236
+ },
237
+ withdrawalFacet: {
238
+ Withdraw() {
239
+ const { revoker, revocable: handler } =
240
+ makeRevocableWithdrawalHandler(this.facets.withdrawalHandler);
241
+ outstandingRevokers.add(revoker);
242
+ // @ts-expect-error Argument of type Guarded<
243
+ return zcf.makeInvitation(handler, 'Withdraw Collateral');
244
+ },
245
+ },
246
+ repeatableWithdrawalHandler: {
247
+ /**
248
+ * @param {ZCFSeat} seat
249
+ */
250
+ handle(seat) {
251
+ seat.exit();
252
+ const { revoker, revocable: invitationMakers } =
253
+ makeRevocableWithdrawalFacet(this.facets.withdrawalFacet);
254
+ outstandingRevokers.add(revoker);
255
+ return harden({ invitationMakers });
256
+ },
257
+ },
168
258
  machine: {
169
259
  // add makeRedeemLiquidityTokensInvitation later. For now just store them
170
260
  /**
@@ -204,6 +294,22 @@ export const prepareAssetReserveKit = async (
204
294
  'getFacetForReportingShortfalls',
205
295
  );
206
296
  },
297
+
298
+ makeSingleWithdrawalInvitation() {
299
+ return this.facets.withdrawalFacet.Withdraw();
300
+ },
301
+
302
+ makeRepeatableWithdrawalInvitation() {
303
+ const handler = this.facets.repeatableWithdrawalHandler;
304
+ return zcf.makeInvitation(handler, 'Repeatable Withdraw Collateral');
305
+ },
306
+
307
+ revokeOutstandingWithdrawalInvitations() {
308
+ for (const revoker of outstandingRevokers.keys()) {
309
+ revoker.revoke();
310
+ }
311
+ outstandingRevokers.clear();
312
+ },
207
313
  },
208
314
  /**
209
315
  * XXX missing governance public methods
@@ -20,4 +20,6 @@ export function getLiquidatableVaults(zcf: ZCF, collateralizationDetails: {
20
20
  import type { TimerService } from '@agoric/time';
21
21
  import type { TimerWaker } from '@agoric/time';
22
22
  import type { PriceQuote } from '@agoric/zoe/tools/types.js';
23
+ import type { SetStore } from '@agoric/store';
24
+ import type { MapStore } from '@agoric/store';
23
25
  //# sourceMappingURL=liquidation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"liquidation.d.ts","sourceRoot":"","sources":["liquidation.js"],"names":[],"m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AC,YAAY,CAAC,kBAClB,UAAU,oBACV,UAAU,oBACV,UAAU,GACR,OAAO,CAAC,IAAI,CAAC,CAqCzB;AAQM,yCAJI,MAAM,CAAC,KAAK,CAAC,UACb,MAAM,CAAC,KAAK,CAAC,GACX;IAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAAE,CAYhE;AAWM,gEALI,IAAI,CAAC,OAAO,0BAA0B,EAAE,qBAAqB,CAAC,SAC9D,IAAI,CAAC,YAAY,CAAC,oBAClB,UAAU,GACR,IAAI,CA0BhB;AAwBM,2CArBI,GAAG,4BAEX;IAA6C,KAAK,EAA1C,UAAU;IACsB,QAAQ,EAAxC,KAAK;IAC2B,MAAM,EAAtC,KAAK;CACb,qBAAQ,UAAU,CACpB,cAAkB,wBAAwB,EAAE,qBAAqB,CAC9D,qBACO,SAAS,KAAK,CAAC,aACf,KAAK,CAAC,KAAK,CAAC,mBACZ,KAAK,CAAC,KAAK,CAAC,GACV;IACR,SAAS,EAAE,SACf,KAAW,EACX;QAAQ,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;KAAE,CAC/D,CAAC;IACF,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB,CAiDH;kCAnS8D,cAAc;gCAAd,cAAc;gCAChD,4BAA4B;8BAFpB,eAAe;8BAAf,eAAe"}
@@ -12,11 +12,11 @@ import { makeCancelTokenMaker } from '../auction/util.js';
12
12
 
13
13
  const trace = makeTracer('LIQ');
14
14
 
15
- /** @import {TimerService} from '@agoric/time' */
16
- /** @import {TimerWaker} from '@agoric/time' */
17
- /** @import {CancelToken} from '@agoric/time' */
18
- /** @import {RelativeTimeRecord} from '@agoric/time' */
19
- /** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */
15
+ /**
16
+ * @import {MapStore, SetStore} from '@agoric/store';
17
+ * @import {RelativeTimeRecord, TimerService, TimerWaker} from '@agoric/time';
18
+ * @import {PriceQuote} from '@agoric/zoe/tools/types.js';
19
+ */
20
20
 
21
21
  const makeCancelToken = makeCancelTokenMaker('liq');
22
22
 
@@ -90,4 +90,5 @@ export function makeOrderedVaultStore(store: MapStore<string, Vault>): {
90
90
  }>>;
91
91
  };
92
92
  import type { Vault } from './vault.js';
93
+ import type { MapStore } from '@agoric/store';
93
94
  //# sourceMappingURL=orderedVaultStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orderedVaultStore.d.ts","sourceRoot":"","sources":["orderedVaultStore.js"],"names":[],"mappings":"AAiBO,6CADK,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;wBAGtB,MAAM,SACN,KAAK;uBAWL,MAAM,KACJ,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAkCuv1B,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAAjB,iBAAiB;;EAD3x1B;2BApDwB,YAAY"}
1
+ {"version":3,"file":"orderedVaultStore.d.ts","sourceRoot":"","sources":["orderedVaultStore.js"],"names":[],"mappings":"AAmBO,6CADK,SAAS,MAAM,EAAE,KAAK,CAAC;wBAGtB,MAAM,SACN,KAAK;uBAWL,MAAM,KACJ,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCnB;2BApDuB,YAAY;8BADT,eAAe"}
@@ -11,8 +11,10 @@ import { fromVaultKey, toVaultKey } from './storeUtils.js';
11
11
  * debt-to-collateral come first.)
12
12
  */
13
13
 
14
- /** @import {Vault} from './vault.js' */
15
- /** @import {CompositeKey} from './storeUtils.js' */
14
+ /**
15
+ * @import {MapStore} from '@agoric/store';
16
+ * @import {Vault} from './vault.js';
17
+ */
16
18
 
17
19
  /** @param {MapStore<string, Vault>} store */
18
20
  export const makeOrderedVaultStore = store => {
@@ -1,4 +1,7 @@
1
- /** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */
1
+ /**
2
+ * @import {MapStore} from '@agoric/store';
3
+ * @import {PriceAuthority} from '@agoric/zoe/tools/types.js';
4
+ */
2
5
  export const CHARGING_PERIOD_KEY: "ChargingPeriod";
3
6
  export const RECORDING_PERIOD_KEY: "RecordingPeriod";
4
7
  export const DEBT_LIMIT_KEY: "DebtLimit";
@@ -1 +1 @@
1
- {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAiBA,8HAA8H;AAE9H,kCAAmC,gBAAgB,CAAC;AACpD,mCAAoC,iBAAiB,CAAC;AAEtD,6BAA8B,WAAW,CAAC;AAC1C,qCAAsC,mBAAmB,CAAC;AAC1D,sCAAuC,oBAAoB,CAAC;AAC5D,sCAAuC,oBAAoB,CAAC;AAC5D,gCAAiC,cAAc,CAAC;AAChD,2BAA4B,SAAS,CAAC;AACtC,mCAAoC,gBAAgB,CAAC;AACrD,uCAAwC,qBAAqB,CAAC;AAC9D,gCAAiC,cAAc,CAAC;;;;;;;AAkEzC,oDAHI,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,oGAC1E,uBAAuB;;;;;;;GAoB9B;AACJ,4EAA4E;AAE5E,iEAYE;AAeK,8MAZI;IACN,0BAA0B,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,KAAK,EAAE,IAAI,CAAC,OA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15,10 @@ import { subtractRatios } from '@agoric/ertp/src/ratio.js';
15
15
  import { makeTracer } from '@agoric/internal/src/index.js';
16
16
  import { amountPattern, ratioPattern } from '../contractSupport.js';
17
17
 
18
- /** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */
18
+ /**
19
+ * @import {MapStore} from '@agoric/store';
20
+ * @import {PriceAuthority} from '@agoric/zoe/tools/types.js';
21
+ */
19
22
 
20
23
  export const CHARGING_PERIOD_KEY = 'ChargingPeriod';
21
24
  export const RECORDING_PERIOD_KEY = 'RecordingPeriod';
@@ -93,7 +93,7 @@ export function makePrioritizedVaults(store: MapStore<string, Vault>): {
93
93
  margin: any;
94
94
  quote: any;
95
95
  interest: any;
96
- }) => globalThis.MapStore<string, import("@endo/exo").Guarded<{
96
+ }) => MapStore<string, import("@endo/exo").Guarded<{
97
97
  getVaultSeat(): globalThis.ZCFSeat;
98
98
  initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
99
99
  publicSubscribers: {
@@ -136,7 +136,7 @@ export function makePrioritizedVaults(store: MapStore<string, Vault>): {
136
136
  getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt;
137
137
  }>>;
138
138
  countVaultsBelow: (crKey: any) => number;
139
- } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
139
+ } & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
140
140
  addVault: (vaultId: VaultId, vault: Vault) => string;
141
141
  entries: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[string, import("@endo/exo").Guarded<{
142
142
  getVaultSeat(): globalThis.ZCFSeat;
@@ -230,7 +230,7 @@ export function makePrioritizedVaults(store: MapStore<string, Vault>): {
230
230
  margin: any;
231
231
  quote: any;
232
232
  interest: any;
233
- }) => globalThis.MapStore<string, import("@endo/exo").Guarded<{
233
+ }) => MapStore<string, import("@endo/exo").Guarded<{
234
234
  getVaultSeat(): globalThis.ZCFSeat;
235
235
  initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
236
236
  publicSubscribers: {
@@ -275,5 +275,6 @@ export function makePrioritizedVaults(store: MapStore<string, Vault>): {
275
275
  countVaultsBelow: (crKey: any) => number;
276
276
  }>;
277
277
  import type { Vault } from './vault.js';
278
+ import type { MapStore } from '@agoric/store';
278
279
  import type { NormalizedDebt } from './storeUtils.js';
279
280
  //# sourceMappingURL=prioritizedVaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prioritizedVaults.d.ts","sourceRoot":"","sources":["prioritizedVaults.js"],"names":[],"mappings":"AAuCO,+CAHI,KAAK,GACH,KAAK,CAMf;AASI,6CAHI,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;wBAsDrB,OAAO,SACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA+Ci2wB,iBAAiB;;;oCA7Ev3wB,cAAc,iBACd,MAAM,CAAC,KAAK,CAAC,WACb,MAAM;wBAlBJ,KAAK,GAAG,SAAS;uBA0BnB,MAAM,KACJ,KAAK;uCAQP,cAAc,iBACd,MAAM,CAAC,KAAK,CAAC,WACb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAwDg2wB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAAjB,iBAAiB;;;;wBAhDv3wB,OAAO,SACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA+Ci2wB,iBAAiB;;;oCA7Ev3wB,cAAc,iBACd,MAAM,CAAC,KAAK,CAAC,WACb,MAAM;wBAlBJ,KAAK,GAAG,SAAS;uBA0BnB,MAAM,KACJ,KAAK;uCAQP,cAAc,iBACd,MAAM,CAAC,KAAK,CAAC,WACb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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