@agoric/zoe 0.27.0-upgrade-20-dev-ef71cfd.0 → 0.27.0-upgrade-19-devnet-dev-5428c4d.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.
- package/bundles/bundle-contractFacet-js-meta.json +275 -270
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +29 -29
- package/src/cleanProposal.d.ts +0 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +2 -4
- package/src/contractFacet/exit.d.ts +1 -1
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/internal-types.d.ts +8 -0
- package/src/contractFacet/internal-types.d.ts.map +1 -0
- package/src/contractFacet/internal-types.js +15 -0
- package/src/contractFacet/offerHandlerStorage.d.ts +1 -1
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +1 -0
- package/src/contractFacet/{types.ts → types-ambient.d.ts} +29 -66
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +2 -8
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/vatRoot.js +4 -5
- package/src/contractFacet/zcfMint.d.ts +2 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +7 -7
- package/src/contractFacet/zcfSeat.js +2 -2
- package/src/contractFacet/zcfZygote.d.ts +1 -9
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +5 -17
- package/src/contractSupport/atomicTransfer.d.ts +0 -6
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +0 -4
- package/src/contractSupport/bondingCurves.js +1 -1
- package/src/contractSupport/index.d.ts +2 -2
- package/src/contractSupport/index.js +19 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts +0 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +1 -3
- package/src/contractSupport/ratio.d.ts +37 -0
- package/src/contractSupport/ratio.d.ts.map +1 -0
- package/src/contractSupport/ratio.js +419 -0
- package/src/contractSupport/safeMath.d.ts +11 -0
- package/src/contractSupport/safeMath.d.ts.map +1 -0
- package/src/contractSupport/safeMath.js +49 -0
- package/src/contractSupport/types-ambient.d.ts.map +1 -1
- package/src/contractSupport/types-ambient.js +0 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -6
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +0 -1
- package/src/contracts/atomicSwap.d.ts +1 -1
- package/src/contracts/auction/index.d.ts +3 -3
- package/src/contracts/automaticRefund.d.ts +3 -3
- package/src/contracts/autoswap.d.ts +0 -4
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +0 -4
- package/src/contracts/barterExchange.d.ts +2 -2
- package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
- package/src/contracts/coveredCall-durable.d.ts +1 -1
- package/src/contracts/coveredCall.d.ts +1 -1
- package/src/contracts/loan/index.d.ts +1 -1
- package/src/contracts/loan/types-ambient.d.ts +13 -13
- package/src/contracts/loan/types-ambient.d.ts.map +1 -1
- package/src/contracts/loan/types-ambient.js +17 -17
- package/src/contracts/mintPayments.d.ts +2 -2
- package/src/contracts/oracle.d.ts +0 -3
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +0 -1
- package/src/contracts/priceAggregator.d.ts +0 -2
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +8 -10
- package/src/contracts/scaledPriceAuthority.d.ts +0 -1
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +0 -1
- package/src/contracts/sellItems.d.ts +1 -1
- package/src/contracts/simpleExchange.d.ts +0 -5
- package/src/contracts/simpleExchange.d.ts.map +1 -1
- package/src/contracts/simpleExchange.js +0 -4
- package/src/contracts/types-ambient.d.ts +7 -7
- package/src/contracts/types-ambient.d.ts.map +1 -1
- package/src/contracts/types-ambient.js +7 -7
- package/src/contracts/valueVow.contract.d.ts +2 -5
- package/src/contracts/valueVow.contract.d.ts.map +1 -1
- package/src/contracts/valueVow.contract.js +0 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/instanceRecordStorage.js +1 -3
- package/src/internal-types.d.ts +5 -15
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +4 -9
- package/src/issuerRecord.d.ts +2 -3
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerRecord.js +2 -6
- package/src/issuerStorage.d.ts +2 -3
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +5 -6
- package/src/typeGuards.d.ts +6 -10
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +5 -7
- package/src/types-ambient.d.ts +40 -0
- package/src/types-ambient.d.ts.map +1 -1
- package/src/types-ambient.js +42 -4
- package/src/zoeService/feeMint.d.ts +0 -1
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +0 -4
- package/src/zoeService/installationStorage.d.ts +2 -3
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +5 -2
- package/src/zoeService/internal-types.d.ts +3 -11
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +3 -9
- package/src/zoeService/invitationQueries.d.ts +3 -3
- package/src/zoeService/invitationQueries.js +3 -3
- package/src/zoeService/makeInvitation.d.ts +0 -1
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +0 -3
- package/src/zoeService/offer/offer.d.ts +0 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +1 -3
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
- package/src/zoeService/originalZoeSeat.js +1 -0
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +2 -0
- package/src/zoeService/types-ambient.d.ts +226 -0
- package/src/zoeService/types-ambient.d.ts.map +1 -1
- package/src/zoeService/types-ambient.js +327 -4
- package/src/zoeService/utils.d.ts +5 -13
- package/src/zoeService/utils.test-d.ts +0 -1
- package/src/zoeService/zoe.d.ts +1 -11
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +1 -8
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +2 -1
- package/src/zoeService/zoeStorageManager.d.ts +5 -5
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +3 -4
- package/tools/fakeVatAdmin.d.ts +2 -9
- package/tools/fakeVatAdmin.d.ts.map +1 -1
- package/tools/fakeVatAdmin.js +10 -18
- package/tools/manualPriceAuthority.d.ts +1 -4
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +0 -1
- package/tools/scriptedOracle.d.ts +2 -6
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +0 -4
- package/tools/setup-zoe.d.ts +6 -12
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +5 -38
- package/tools/test-utils.d.ts +1 -1
- package/tools/test-utils.js +1 -1
- package/tools/types.d.ts +0 -1
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +0 -1
- package/src/contractFacet/types.d.ts +0 -184
- package/src/contractFacet/types.d.ts.map +0 -1
- package/src/types-index.d.ts +0 -4
- package/src/types-index.js +0 -2
- package/src/types.d.ts +0 -29
- package/src/types.d.ts.map +0 -1
- package/src/types.ts +0 -44
- package/src/zoeService/types.d.ts +0 -238
- package/src/zoeService/types.d.ts.map +0 -1
- package/src/zoeService/types.ts +0 -307
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import type { AdditionalDisplayInfo, Amount, AnyAmount, AssetKind, Brand, DisplayInfo, Issuer, Payment } from '@agoric/ertp';
|
|
2
|
-
import type { Subscriber } from '@agoric/notifier';
|
|
3
|
-
import type { ERef } from '@endo/far';
|
|
4
|
-
import type { Passable } from '@endo/pass-style';
|
|
5
|
-
import type { Key, Pattern } from '@endo/patterns';
|
|
6
|
-
import type { AmountKeywordRecord, ExitRule, FeeMintAccess, Instance, InvitationDetails, Keyword, ProposalRecord, StandardTerms, UserSeat, ZoeService } from '../types-index.js';
|
|
7
|
-
import type { ContractStartFunction } from '../zoeService/utils.js';
|
|
8
|
-
/**
|
|
9
|
-
* Any passable non-thenable. Often an explanatory string.
|
|
10
|
-
*/
|
|
11
|
-
export type Completion = Passable;
|
|
12
|
-
export type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit;
|
|
13
|
-
export type InvitationAmount = Amount<'set', InvitationDetails>;
|
|
14
|
-
export type ZoeIssuerRecord<K extends AssetKind = AssetKind, M extends Key = Key> = {
|
|
15
|
-
brand: Brand<K>;
|
|
16
|
-
issuer: Issuer<K, M>;
|
|
17
|
-
assetKind: K;
|
|
18
|
-
displayInfo?: DisplayInfo<K>;
|
|
19
|
-
};
|
|
20
|
-
export type Allocation = Record<Keyword, AnyAmount>;
|
|
21
|
-
/**
|
|
22
|
-
* Zoe Contract Facet
|
|
23
|
-
*
|
|
24
|
-
* The Zoe interface specific to a contract instance. The Zoe Contract
|
|
25
|
-
* Facet is an API object used by running contract instances to access
|
|
26
|
-
* the Zoe state for that instance. The Zoe Contract Facet is accessed
|
|
27
|
-
* synchronously from within the contract, and usually is referred to
|
|
28
|
-
* in code as zcf.
|
|
29
|
-
*/
|
|
30
|
-
export type ZCF<CT = Record<string, unknown>> = {
|
|
31
|
-
/**
|
|
32
|
-
* - atomically reallocate amounts among seats.
|
|
33
|
-
*/
|
|
34
|
-
atomicRearrange: (transfers: TransferPart[]) => void;
|
|
35
|
-
/**
|
|
36
|
-
* - check
|
|
37
|
-
* whether a keyword is valid and unique and could be added in
|
|
38
|
-
* `saveIssuer`
|
|
39
|
-
*/
|
|
40
|
-
assertUniqueKeyword: (keyword: Keyword) => void;
|
|
41
|
-
/**
|
|
42
|
-
* Informs Zoe about an issuer and returns a promise for acknowledging
|
|
43
|
-
* when the issuer is added and ready.
|
|
44
|
-
*
|
|
45
|
-
* @returns the AmountMath and brand synchronously accessible after
|
|
46
|
-
* saving
|
|
47
|
-
*/
|
|
48
|
-
saveIssuer: <I extends Issuer>(issuerP: ERef<I>, keyword: Keyword) => Promise<I extends Issuer<infer K, infer M> ? ZoeIssuerRecord<K, M> : never>;
|
|
49
|
-
/**
|
|
50
|
-
* Make a credible Zoe invitation for a particular smart contract
|
|
51
|
-
* indicated by the `instance` in the details of the invitation. Zoe
|
|
52
|
-
* also puts the `installation` and a unique `handle` in the details
|
|
53
|
-
* of the invitation. The contract must provide a `description` for
|
|
54
|
-
* the invitation and should include whatever information is necessary
|
|
55
|
-
* for a potential buyer of the invitation to know what they are
|
|
56
|
-
* getting in the `customDetails`. `customDetails` will be
|
|
57
|
-
* placed in the details of the invitation.
|
|
58
|
-
*/
|
|
59
|
-
makeInvitation: <R, A = undefined>(offerHandler: OfferHandler<ERef<R>, A>, description: string, customDetails?: object, proposalShape?: Pattern) => Promise<Invitation<R, A>>;
|
|
60
|
-
shutdown: (completion: Completion) => void;
|
|
61
|
-
shutdownWithFailure: import('@agoric/swingset-vat').ShutdownWithFailure;
|
|
62
|
-
getZoeService: () => ERef<ZoeService>;
|
|
63
|
-
getInvitationIssuer: () => Issuer<'set'>;
|
|
64
|
-
getTerms: () => StandardTerms & CT;
|
|
65
|
-
getBrandForIssuer: <K extends AssetKind>(issuer: Issuer<K>) => Brand<K>;
|
|
66
|
-
getIssuerForBrand: <K_1 extends AssetKind>(brand: Brand<K_1>) => Issuer<K_1>;
|
|
67
|
-
getAssetKind: (brand: Brand) => AssetKind;
|
|
68
|
-
makeZCFMint: <K_2 extends AssetKind = 'nat'>(keyword: Keyword, assetKind?: K_2 | undefined, displayInfo?: AdditionalDisplayInfo, options?: import('@agoric/ertp').IssuerOptionsRecord) => Promise<ZCFMint<K_2>>;
|
|
69
|
-
registerFeeMint: ZCFRegisterFeeMint;
|
|
70
|
-
makeEmptySeatKit: ZCFMakeEmptySeatKit;
|
|
71
|
-
setTestJig: SetTestJig;
|
|
72
|
-
stopAcceptingOffers: () => Promise<void>;
|
|
73
|
-
setOfferFilter: (strings: Array<string>) => Promise<void>;
|
|
74
|
-
getOfferFilter: () => Promise<Array<string>>;
|
|
75
|
-
getInstance: () => Instance;
|
|
76
|
-
};
|
|
77
|
-
export type TransferPart = [
|
|
78
|
-
fromSeat?: ZCFSeat,
|
|
79
|
-
toSeat?: ZCFSeat,
|
|
80
|
-
fromAmounts?: AmountKeywordRecord,
|
|
81
|
-
toAmounts?: AmountKeywordRecord
|
|
82
|
-
];
|
|
83
|
-
export type ZCFRegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => Promise<ZCFMint<'nat'>>;
|
|
84
|
-
/**
|
|
85
|
-
* Provide a jig object for testing purposes only.
|
|
86
|
-
*
|
|
87
|
-
* The contract code provides a callback whose return result will
|
|
88
|
-
* be made available to the test that started this contract. The
|
|
89
|
-
* supplied callback will only be called in a testing context,
|
|
90
|
-
* never in production; i.e., it is only called if `testJigSetter`
|
|
91
|
-
* was supplied.
|
|
92
|
-
*
|
|
93
|
-
* If no `testFn` is supplied, then an empty jig will be used.
|
|
94
|
-
* An additional `zcf` property set to the current ContractFacet
|
|
95
|
-
* will be appended to the returned jig object (overriding any
|
|
96
|
-
* provided by the `testFn`).
|
|
97
|
-
*/
|
|
98
|
-
export type SetTestJig = (testFn?: () => Record<string, unknown>) => void;
|
|
99
|
-
export type ZCFMint<K extends AssetKind = AssetKind> = {
|
|
100
|
-
getIssuerRecord: () => ZoeIssuerRecord<K>;
|
|
101
|
-
/**
|
|
102
|
-
* All the amounts in gains must be of this ZCFMint's brand.
|
|
103
|
-
* The gains' keywords are in the namespace of that seat.
|
|
104
|
-
* Add the gains to that seat's allocation.
|
|
105
|
-
* The resulting state must be offer safe. (Currently, increasing assets can
|
|
106
|
-
* never violate offer safety anyway.)
|
|
107
|
-
*
|
|
108
|
-
* Mint that amount of assets into the pooled purse.
|
|
109
|
-
* If a seat is provided, it is returned. Otherwise a new seat is
|
|
110
|
-
* returned.
|
|
111
|
-
*/
|
|
112
|
-
mintGains: (gains: AmountKeywordRecord, zcfSeat?: ZCFSeat) => ZCFSeat;
|
|
113
|
-
/**
|
|
114
|
-
* All the amounts in losses must be of this ZCFMint's brand.
|
|
115
|
-
* The losses' keywords are in the namespace of that seat.
|
|
116
|
-
* Subtract losses from that seat's allocation.
|
|
117
|
-
* The resulting state must be offer safe.
|
|
118
|
-
*
|
|
119
|
-
* Burn that amount of assets from the pooled purse.
|
|
120
|
-
*/
|
|
121
|
-
burnLosses: (losses: AmountKeywordRecord, zcfSeat: ZCFSeat) => void;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* fail called with the reason for this failure, where reason is
|
|
125
|
-
* normally an instanceof Error.
|
|
126
|
-
*/
|
|
127
|
-
export type ZCFSeatFail = (reason: unknown) => Error;
|
|
128
|
-
export type ZCFSeat = import('@endo/pass-style').RemotableObject & {
|
|
129
|
-
exit: (completion?: Completion) => void;
|
|
130
|
-
fail: ZCFSeatFail;
|
|
131
|
-
getSubscriber: () => Promise<Subscriber<Allocation>>;
|
|
132
|
-
hasExited: () => boolean;
|
|
133
|
-
getProposal: () => ProposalRecord;
|
|
134
|
-
/**
|
|
135
|
-
* @param brand used for filling in an empty amount if the `keyword`
|
|
136
|
-
* is not present in the allocation
|
|
137
|
-
*/
|
|
138
|
-
getAmountAllocated: <B extends Brand<any>>(keyword: Keyword, brand?: B) => B extends Brand<infer K> ? Amount<K> : Amount;
|
|
139
|
-
getCurrentAllocation: () => Allocation;
|
|
140
|
-
isOfferSafe: (newAllocation: Allocation) => boolean;
|
|
141
|
-
};
|
|
142
|
-
export type ZcfSeatKit = {
|
|
143
|
-
zcfSeat: ZCFSeat;
|
|
144
|
-
userSeat: Promise<UserSeat>;
|
|
145
|
-
};
|
|
146
|
-
export type HandleOffer<OR, OA> = (seat: ZCFSeat, offerArgs: OA) => OR;
|
|
147
|
-
export type OfferHandler<OR = unknown, OA = never> = HandleOffer<OR, OA> | {
|
|
148
|
-
handle: HandleOffer<OR, OA>;
|
|
149
|
-
};
|
|
150
|
-
export type ContractMeta<SF extends ContractStartFunction = ContractStartFunction> = {
|
|
151
|
-
customTermsShape?: Record<Parameters<SF>[0] extends ZCF<infer CT> ? keyof CT : never, Pattern>;
|
|
152
|
-
privateArgsShape?: {
|
|
153
|
-
[K in keyof Parameters<SF>[1]]: Pattern;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* - `none` means that the contract is not upgradable.
|
|
157
|
-
* - `canUpgrade` means this code can perform an upgrade
|
|
158
|
-
* - `canBeUpgraded` means that the contract stores kinds durably such that the next version can upgrade
|
|
159
|
-
*/
|
|
160
|
-
upgradability?: 'none' | 'canBeUpgraded' | 'canUpgrade' | undefined;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* API for a contract start function.
|
|
164
|
-
*
|
|
165
|
-
* CAVEAT: assumes synchronous
|
|
166
|
-
*/
|
|
167
|
-
export type ContractStartFn<PF = any, CF = any, CT = any, PA = any> = (zcf: ZCF<CT>, privateArgs: PA, baggage: import('@agoric/vat-data').Baggage) => ContractStartFnResult<PF, CF>;
|
|
168
|
-
export type ContractStartFnResult<PF, CF> = {
|
|
169
|
-
publicFacet?: PF;
|
|
170
|
-
creatorFacet?: CF;
|
|
171
|
-
creatorInvitation?: Promise<Invitation<any, any>> | undefined;
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* @deprecated use the parameterized version
|
|
175
|
-
*/
|
|
176
|
-
export type AdminFacet = import('../zoeService/utils.js').AdminFacet<any>;
|
|
177
|
-
declare const OfferReturn: unique symbol;
|
|
178
|
-
declare const OfferArgs: unique symbol;
|
|
179
|
-
export type Invitation<R = unknown, A = undefined> = Payment<'set', InvitationDetails> & {
|
|
180
|
-
[OfferReturn]?: R;
|
|
181
|
-
[OfferArgs]?: A;
|
|
182
|
-
};
|
|
183
|
-
export {};
|
|
184
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,EACL,WAAW,EACX,MAAM,EACN,OAAO,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EACV,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,aAAa,EACb,QAAQ,EACR,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;AAClC,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,KAAK,UAAU,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAEhE,MAAM,MAAM,eAAe,CACzB,CAAC,SAAS,SAAS,GAAG,SAAS,EAC/B,CAAC,SA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,CAAC,EAAE,CAAC,EACZ,WAAW,EAAE,EAAE,EACf,OAAO,EAAE,OAAO,kBAAkB,EAAE,OAAO,KACxC,qBAAqB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACnC,MAAM,MAAM,qBAAqB,CAAC,EAAE,EAAE,EAAE,IAAI;IAC1C,WAAW,CAAC,EAAE,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,EAAE,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,wBAAwB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AAE1E,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,MAAM,CAAC;AACzC,OAAO,CAAC,MAAM,SAAS,EAAE,OAAO,MAAM,CAAC;AACvC,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,SAAS,IAAI,OAAO,CAC1D,KAAK,EACL,iBAAiB,CAClB,GAAG;IAEF,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;CACjB,CAAC"}
|
package/src/types-index.d.ts
DELETED
package/src/types-index.js
DELETED
package/src/types.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Issuer, Brand } from '@agoric/ertp';
|
|
2
|
-
import type { RemotableObject } from '@endo/pass-style';
|
|
3
|
-
/**
|
|
4
|
-
* Alias for RemotableObject
|
|
5
|
-
*/
|
|
6
|
-
export type Handle<H extends string> = RemotableObject<H>;
|
|
7
|
-
/** Must start with a capital letter. */
|
|
8
|
-
export type Keyword = string;
|
|
9
|
-
/**
|
|
10
|
-
* - an opaque handle for an invitation
|
|
11
|
-
*/
|
|
12
|
-
export type InvitationHandle = Handle<'Invitation'>;
|
|
13
|
-
export type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
|
|
14
|
-
export type IssuerPKeywordRecord = Record<Keyword, import('@endo/far').ERef<Issuer<any>>>;
|
|
15
|
-
export type BrandKeywordRecord = Record<Keyword, Brand<any>>;
|
|
16
|
-
export type StandardTerms = {
|
|
17
|
-
/**
|
|
18
|
-
* - record with
|
|
19
|
-
* keywords keys, issuer values
|
|
20
|
-
*/
|
|
21
|
-
issuers: IssuerKeywordRecord;
|
|
22
|
-
/**
|
|
23
|
-
* - record with keywords
|
|
24
|
-
* keys, brand values
|
|
25
|
-
*/
|
|
26
|
-
brands: BrandKeywordRecord;
|
|
27
|
-
};
|
|
28
|
-
export type AnyTerms = StandardTerms & Record<string, any>;
|
|
29
|
-
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EAIN,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAK1D,wCAAwC;AACxC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,oBAAoB,GAAG,MAAM,CACvC,OAAO,EACP,OAAO,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACtC,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,OAAO,EAAE,mBAAmB,CAAC;IAC7B;;;OAGG;IACH,MAAM,EAAE,kBAAkB,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
package/src/types.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Issuer,
|
|
3
|
-
Brand,
|
|
4
|
-
AssetKind,
|
|
5
|
-
DisplayInfo,
|
|
6
|
-
AnyAmount,
|
|
7
|
-
} from '@agoric/ertp';
|
|
8
|
-
import type { RemotableObject } from '@endo/pass-style';
|
|
9
|
-
import type { Key } from '@endo/patterns';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Alias for RemotableObject
|
|
13
|
-
*/
|
|
14
|
-
export type Handle<H extends string> = RemotableObject<H>;
|
|
15
|
-
|
|
16
|
-
// Typing this as Capitalize<string> would be more accurate but requires
|
|
17
|
-
// frequent casting. Revisit once .ts syntax is more common. Even then,
|
|
18
|
-
// may not be worth the effort since Zoe 2 probably will not have keywords.
|
|
19
|
-
/** Must start with a capital letter. */
|
|
20
|
-
export type Keyword = string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* - an opaque handle for an invitation
|
|
24
|
-
*/
|
|
25
|
-
export type InvitationHandle = Handle<'Invitation'>;
|
|
26
|
-
export type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
|
|
27
|
-
export type IssuerPKeywordRecord = Record<
|
|
28
|
-
Keyword,
|
|
29
|
-
import('@endo/far').ERef<Issuer<any>>
|
|
30
|
-
>;
|
|
31
|
-
export type BrandKeywordRecord = Record<Keyword, Brand<any>>;
|
|
32
|
-
export type StandardTerms = {
|
|
33
|
-
/**
|
|
34
|
-
* - record with
|
|
35
|
-
* keywords keys, issuer values
|
|
36
|
-
*/
|
|
37
|
-
issuers: IssuerKeywordRecord;
|
|
38
|
-
/**
|
|
39
|
-
* - record with keywords
|
|
40
|
-
* keys, brand values
|
|
41
|
-
*/
|
|
42
|
-
brands: BrandKeywordRecord;
|
|
43
|
-
};
|
|
44
|
-
export type AnyTerms = StandardTerms & Record<string, any>;
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import type { AnyAmount, AssetKind, DisplayInfo, Issuer, NatValue, Payment } from '@agoric/ertp';
|
|
2
|
-
import type { Subscriber } from '@agoric/notifier';
|
|
3
|
-
import type { ERef, EReturn } from '@endo/eventual-send';
|
|
4
|
-
import type { Bundle, BundleID } from '@agoric/swingset-vat';
|
|
5
|
-
import type { ContractStartFunction, StartParams } from './utils.js';
|
|
6
|
-
import type { Keyword, InvitationHandle, BrandKeywordRecord, Handle, IssuerKeywordRecord } from '../types.js';
|
|
7
|
-
import type { Allocation } from '../types-index.js';
|
|
8
|
-
/**
|
|
9
|
-
* @see {@link https://github.com/sindresorhus/type-fest/blob/main/source/is-any.d.ts}
|
|
10
|
-
*/
|
|
11
|
-
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
12
|
-
/**
|
|
13
|
-
* Zoe provides a framework for deploying and working with smart
|
|
14
|
-
* contracts. It is accessed as a long-lived and well-trusted service
|
|
15
|
-
* that enforces offer safety for the contracts that use it. Zoe has a
|
|
16
|
-
* single `invitationIssuer` for the entirety of its lifetime. By
|
|
17
|
-
* having a reference to Zoe, a user can get the `invitationIssuer`
|
|
18
|
-
* and thus validate any `invitation` they receive from someone else.
|
|
19
|
-
*
|
|
20
|
-
* Zoe has two different facets: the public Zoe service and the
|
|
21
|
-
* contract facet (ZCF). Each contract instance has a copy of ZCF
|
|
22
|
-
* within its vat. The contract and ZCF never have direct access to
|
|
23
|
-
* the users' payments or the Zoe purses.
|
|
24
|
-
*/
|
|
25
|
-
export type ZoeService = {
|
|
26
|
-
/**
|
|
27
|
-
* Zoe has a single `invitationIssuer` for the entirety of its
|
|
28
|
-
* lifetime. By having a reference to Zoe, a user can get the
|
|
29
|
-
* `invitationIssuer` and thus validate any `invitation` they receive
|
|
30
|
-
* from someone else. The mint associated with the invitationIssuer
|
|
31
|
-
* creates the ERTP payments that represent the right to interact with
|
|
32
|
-
* a smart contract in particular ways.
|
|
33
|
-
*/
|
|
34
|
-
getInvitationIssuer: GetInvitationIssuer;
|
|
35
|
-
install: InstallBundle;
|
|
36
|
-
installBundleID: InstallBundleID;
|
|
37
|
-
startInstance: import('./utils.js').StartInstance;
|
|
38
|
-
offer: Offer;
|
|
39
|
-
getPublicFacet: <I extends Instance>(instance: ERef<I>) => Promise<IsAny<I> extends true ? any : I extends import('./utils.js').Instance<infer SF extends ContractStartFunction> ? IsAny<SF> extends true ? unknown : EReturn<SF>['publicFacet'] : never>;
|
|
40
|
-
getIssuers: GetIssuers;
|
|
41
|
-
getBrands: GetBrands;
|
|
42
|
-
getTerms: <I extends ERef<Instance>>(instance: I) => IsAny<I> extends true ? Promise<any> : I extends ERef<import('./utils.js').Instance<infer SF extends ContractStartFunction>> ? IsAny<SF> extends true ? Promise<unknown> : Promise<StartParams<SF>['terms']> : never;
|
|
43
|
-
getOfferFilter: (instance: ERef<Instance>) => Promise<string[]>;
|
|
44
|
-
getInstallationForInstance: GetInstallationForInstance;
|
|
45
|
-
getInstance: GetInstance;
|
|
46
|
-
getInstallation: GetInstallation;
|
|
47
|
-
/**
|
|
48
|
-
* Return an object with the instance, installation, description, invitation
|
|
49
|
-
* handle, and any custom properties specific to the contract.
|
|
50
|
-
*/
|
|
51
|
-
getInvitationDetails: GetInvitationDetails;
|
|
52
|
-
getFeeIssuer: GetFeeIssuer;
|
|
53
|
-
getConfiguration: GetConfiguration;
|
|
54
|
-
getBundleIDFromInstallation: GetBundleIDFromInstallation;
|
|
55
|
-
/**
|
|
56
|
-
* Return the pattern (if any) associated with the invitationHandle that a
|
|
57
|
-
* proposal is required to match to be accepted by zoe.offer().
|
|
58
|
-
*/
|
|
59
|
-
getProposalShapeForInvitation: (invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined;
|
|
60
|
-
};
|
|
61
|
-
type GetInvitationIssuer = () => Promise<Issuer<'set', InvitationDetails>>;
|
|
62
|
-
type GetFeeIssuer = () => Promise<Issuer<'nat'>>;
|
|
63
|
-
type GetConfiguration = () => {
|
|
64
|
-
feeIssuerConfig: FeeIssuerConfig;
|
|
65
|
-
};
|
|
66
|
-
export type GetIssuers = (instance: import('./utils.js').Instance<any>) => Promise<IssuerKeywordRecord>;
|
|
67
|
-
export type GetBrands = (instance: import('./utils.js').Instance<any>) => Promise<BrandKeywordRecord>;
|
|
68
|
-
type GetInstallationForInstance = (instance: import('./utils.js').Instance<any>) => Promise<Installation>;
|
|
69
|
-
export type GetInstance = (invitation: ERef<import('../types-index.js').Invitation>) => Promise<import('./utils.js').Instance<any>>;
|
|
70
|
-
export type GetInstallation = (invitation: ERef<import('../types-index.js').Invitation>) => Promise<Installation>;
|
|
71
|
-
export type GetInvitationDetails = (invitation: ERef<import('../types-index.js').Invitation<any, any>>) => Promise<InvitationDetails>;
|
|
72
|
-
/**
|
|
73
|
-
* Create an installation by safely evaluating the code and
|
|
74
|
-
* registering it with Zoe. Returns an installation.
|
|
75
|
-
*/
|
|
76
|
-
export type InstallBundle = (bundle: Bundle | SourceBundle, bundleLabel?: string | undefined) => Promise<Installation>;
|
|
77
|
-
/**
|
|
78
|
-
* Create an installation from a Bundle ID. Returns an installation.
|
|
79
|
-
*/
|
|
80
|
-
export type InstallBundleID = (bundleID: BundleID, bundleLabel?: string | undefined) => Promise<Installation>;
|
|
81
|
-
/**
|
|
82
|
-
* Verify that an alleged Installation is real, and return the Bundle ID it
|
|
83
|
-
* will use for contract code.
|
|
84
|
-
*/
|
|
85
|
-
export type GetBundleIDFromInstallation = (allegedInstallation: ERef<Installation>) => Promise<string>;
|
|
86
|
-
/**
|
|
87
|
-
* To redeem an invitation, the user normally provides a proposal (their
|
|
88
|
-
* rules for the offer) as well as payments to be escrowed by Zoe. If
|
|
89
|
-
* either the proposal or payments would be empty, indicate this by
|
|
90
|
-
* omitting that argument or passing undefined, rather than passing an
|
|
91
|
-
* empty record.
|
|
92
|
-
*
|
|
93
|
-
* The proposal has three parts: `want` and `give` are used by Zoe to
|
|
94
|
-
* enforce offer safety, and `exit` is used to specify the particular
|
|
95
|
-
* payout-liveness policy that Zoe can guarantee. `want` and `give`
|
|
96
|
-
* are objects with keywords as keys and amounts as values.
|
|
97
|
-
* `paymentKeywordRecord` is a record with keywords as keys, and the
|
|
98
|
-
* values are the actual payments to be escrowed. A payment is
|
|
99
|
-
* expected for every rule under `give`.
|
|
100
|
-
*/
|
|
101
|
-
export type Offer = <Result, Args = undefined>(invitation: ERef<import('../types-index.js').Invitation<Result, Args>>, proposal?: Proposal, paymentKeywordRecord?: PaymentPKeywordRecord, offerArgs?: Args) => Promise<UserSeat<Result>>;
|
|
102
|
-
/**
|
|
103
|
-
* Zoe uses seats to access or manipulate offers. They let contracts and users
|
|
104
|
-
* interact with them. Zoe has two kinds of seats. ZCFSeats are used within
|
|
105
|
-
* contracts and with zcf methods. UserSeats represent offers external to Zoe
|
|
106
|
-
* and the contract. The party who exercises an invitation and sends the offer()
|
|
107
|
-
* message to Zoe gets a UserSeat that can check payouts' status or retrieve the
|
|
108
|
-
* result of processing the offer in the contract. This varies, but examples are
|
|
109
|
-
* a string and an invitation for another seat.
|
|
110
|
-
*
|
|
111
|
-
* Also, a UserSeat can be handed to an agent outside Zoe and the contract,
|
|
112
|
-
* letting them query or monitor the current state, access the payouts and
|
|
113
|
-
* result, and, if it's allowed for this seat, call tryExit().
|
|
114
|
-
*
|
|
115
|
-
* Since anyone can attempt to exit the seat if they have a reference to it, you
|
|
116
|
-
* should only share a UserSeat with trusted parties.
|
|
117
|
-
*
|
|
118
|
-
* UserSeat includes queries for the associated offer's current state and an
|
|
119
|
-
* operation to request that the offer exit, as follows:
|
|
120
|
-
*/
|
|
121
|
-
export type UserSeat<OR = unknown> = {
|
|
122
|
-
getProposal: () => Promise<ProposalRecord>;
|
|
123
|
-
/**
|
|
124
|
-
* returns a promise for a KeywordPaymentRecord containing all the payouts from
|
|
125
|
-
* this seat. The promise will resolve after the seat has exited.
|
|
126
|
-
*/
|
|
127
|
-
getPayouts: () => Promise<PaymentPKeywordRecord>;
|
|
128
|
-
/**
|
|
129
|
-
* returns a promise for the Payment corresponding to the indicated keyword.
|
|
130
|
-
* The promise will resolve after the seat has exited. If there is no payment
|
|
131
|
-
* corresponding to the keyword, an error will be thrown. (It used to return
|
|
132
|
-
* undefined.)
|
|
133
|
-
*/
|
|
134
|
-
getPayout: (keyword: Keyword) => Promise<Payment<any, any>>;
|
|
135
|
-
getOfferResult: () => Promise<OR>;
|
|
136
|
-
/**
|
|
137
|
-
* Note: Only works if the seat's `proposal` has an `OnDemand` `exit` clause. Zoe's
|
|
138
|
-
* offer-safety guarantee applies no matter how a seat's interaction with a
|
|
139
|
-
* contract ends. Under normal circumstances, the participant might be able to
|
|
140
|
-
* call `tryExit()`, or the contract might do something explicitly. On exiting,
|
|
141
|
-
* the seat holder gets its current `allocation` and the `seat` can no longer
|
|
142
|
-
* interact with the contract.
|
|
143
|
-
*/
|
|
144
|
-
tryExit?: (() => void) | undefined;
|
|
145
|
-
/**
|
|
146
|
-
* Returns true if the seat has exited, false if it is still active.
|
|
147
|
-
*/
|
|
148
|
-
hasExited: () => Promise<boolean>;
|
|
149
|
-
/**
|
|
150
|
-
* returns 1 if the proposal's
|
|
151
|
-
* want clause was satisfied by the final allocation, otherwise 0. This is
|
|
152
|
-
* numeric to support a planned enhancement called "multiples" which will allow
|
|
153
|
-
* the return value to be any non-negative number. The promise will resolve
|
|
154
|
-
* after the seat has exited.
|
|
155
|
-
*/
|
|
156
|
-
numWantsSatisfied: () => Promise<0 | 1>;
|
|
157
|
-
/**
|
|
158
|
-
* return a promise for the final allocation. The promise will resolve after the
|
|
159
|
-
* seat has exited.
|
|
160
|
-
*/
|
|
161
|
-
getFinalAllocation: () => Promise<Allocation>;
|
|
162
|
-
/**
|
|
163
|
-
* returns a subscriber that
|
|
164
|
-
* will be notified when the seat has exited or failed.
|
|
165
|
-
*/
|
|
166
|
-
getExitSubscriber: () => Subscriber<import('../types-index.js').Completion>;
|
|
167
|
-
};
|
|
168
|
-
export type Proposal = Partial<ProposalRecord>;
|
|
169
|
-
export type ProposalRecord = {
|
|
170
|
-
give: AmountKeywordRecord;
|
|
171
|
-
want: AmountKeywordRecord;
|
|
172
|
-
exit: ExitRule;
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* The keys are keywords, and the values are amounts. For example:
|
|
176
|
-
* { Asset: AmountMath.make(assetBrand, 5n), Price:
|
|
177
|
-
* AmountMath.make(priceBrand, 9n) }
|
|
178
|
-
*/
|
|
179
|
-
export type AmountKeywordRecord = Record<Keyword, AnyAmount>;
|
|
180
|
-
export type Waker = {
|
|
181
|
-
wake: () => void;
|
|
182
|
-
};
|
|
183
|
-
export type OnDemandExitRule = {
|
|
184
|
-
onDemand: null;
|
|
185
|
-
};
|
|
186
|
-
export type WaivedExitRule = {
|
|
187
|
-
waived: null;
|
|
188
|
-
};
|
|
189
|
-
export type AfterDeadlineExitRule = {
|
|
190
|
-
afterDeadline: {
|
|
191
|
-
timer: import('@agoric/time').TimerService;
|
|
192
|
-
deadline: import('@agoric/time').Timestamp;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* The possible keys are 'waived', 'onDemand', and 'afterDeadline'.
|
|
197
|
-
* `timer` and `deadline` only are used for the `afterDeadline` key.
|
|
198
|
-
* The possible records are:
|
|
199
|
-
* `{ waived: null }`
|
|
200
|
-
* `{ onDemand: null }`
|
|
201
|
-
* `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }`
|
|
202
|
-
*/
|
|
203
|
-
export type ExitRule = OnDemandExitRule | WaivedExitRule | AfterDeadlineExitRule;
|
|
204
|
-
export type Instance<SF = any> = import('./utils.js').Instance<SF>;
|
|
205
|
-
export type ZCFSpec = {
|
|
206
|
-
bundleCap: import('@agoric/swingset-vat').BundleCap;
|
|
207
|
-
} | {
|
|
208
|
-
name: string;
|
|
209
|
-
} | {
|
|
210
|
-
/** Bundle ID */
|
|
211
|
-
id: string;
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* Opaque type for a JSONable source bundle
|
|
215
|
-
*/
|
|
216
|
-
export type SourceBundle = Record<string, any>;
|
|
217
|
-
export type PaymentPKeywordRecord = Record<Keyword, ERef<Payment<any>>>;
|
|
218
|
-
export type PaymentKeywordRecord = Record<Keyword, Payment<any>>;
|
|
219
|
-
export type InvitationDetails = {
|
|
220
|
-
installation: Installation;
|
|
221
|
-
instance: import('./utils.js').Instance<any>;
|
|
222
|
-
handle: InvitationHandle;
|
|
223
|
-
description: string;
|
|
224
|
-
customDetails?: Record<string, any> | undefined;
|
|
225
|
-
};
|
|
226
|
-
export type Installation<SF = any> = import('./utils.js').Installation<SF>;
|
|
227
|
-
export type InstallationStart<I extends Installation> = import('./utils.js').InstallationStart<I>;
|
|
228
|
-
export type FeeIssuerConfig = {
|
|
229
|
-
name: string;
|
|
230
|
-
assetKind: AssetKind;
|
|
231
|
-
displayInfo: DisplayInfo;
|
|
232
|
-
};
|
|
233
|
-
export type ZoeFeesConfig = {
|
|
234
|
-
getPublicFacetFee: NatValue;
|
|
235
|
-
};
|
|
236
|
-
export type FeeMintAccess = Handle<'feeMintAccess'>;
|
|
237
|
-
export {};
|
|
238
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,EACR,OAAO,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACn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