@agoric/zoe 0.26.3-dev-c56324b.0 → 0.26.3-dev-303a9f2.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 +97 -102
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +15 -15
- package/src/contractFacet/types-ambient.d.ts +12 -8
- package/src/contractSupport/types-ambient.js +1 -1
- package/src/contracts/oracle.d.ts +23 -1
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +4 -0
- package/src/contracts/priceAggregator.d.ts +88 -1
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +1 -0
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +2 -1
- package/src/types-ambient.js +1 -1
- package/src/zoeService/startInstance.js +1 -1
- package/src/zoeService/types-ambient.js +1 -1
- package/src/zoeService/utils.d.ts +24 -37
- package/src/zoeService/utils.test-d.ts +1 -1
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +2 -4
- package/tools/scriptedOracle.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/zoe",
|
|
3
|
-
"version": "0.26.3-dev-
|
|
3
|
+
"version": "0.26.3-dev-303a9f2.0+303a9f2",
|
|
4
4
|
"description": "Zoe: the Smart Contract Framework for Offer Enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/zoeService/zoe.js",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agoric/assert": "0.6.1-dev-
|
|
47
|
-
"@agoric/base-zone": "0.1.1-dev-
|
|
48
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
49
|
-
"@agoric/internal": "0.3.3-dev-
|
|
50
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
51
|
-
"@agoric/store": "0.9.3-dev-
|
|
52
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
53
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
54
|
-
"@agoric/time": "0.3.3-dev-
|
|
55
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
56
|
-
"@agoric/zone": "0.2.3-dev-
|
|
46
|
+
"@agoric/assert": "0.6.1-dev-303a9f2.0+303a9f2",
|
|
47
|
+
"@agoric/base-zone": "0.1.1-dev-303a9f2.0+303a9f2",
|
|
48
|
+
"@agoric/ertp": "0.16.3-dev-303a9f2.0+303a9f2",
|
|
49
|
+
"@agoric/internal": "0.3.3-dev-303a9f2.0+303a9f2",
|
|
50
|
+
"@agoric/notifier": "0.6.3-dev-303a9f2.0+303a9f2",
|
|
51
|
+
"@agoric/store": "0.9.3-dev-303a9f2.0+303a9f2",
|
|
52
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-303a9f2.0+303a9f2",
|
|
53
|
+
"@agoric/swingset-vat": "0.32.3-dev-303a9f2.0+303a9f2",
|
|
54
|
+
"@agoric/time": "0.3.3-dev-303a9f2.0+303a9f2",
|
|
55
|
+
"@agoric/vat-data": "0.5.3-dev-303a9f2.0+303a9f2",
|
|
56
|
+
"@agoric/zone": "0.2.3-dev-303a9f2.0+303a9f2",
|
|
57
57
|
"@endo/bundle-source": "^3.2.3",
|
|
58
58
|
"@endo/captp": "^4.2.0",
|
|
59
59
|
"@endo/common": "^1.2.2",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"yargs-parser": "^21.1.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@agoric/kmarshal": "0.1.1-dev-
|
|
71
|
+
"@agoric/kmarshal": "0.1.1-dev-303a9f2.0+303a9f2",
|
|
72
72
|
"@endo/init": "^1.1.2",
|
|
73
73
|
"ava": "^5.3.0",
|
|
74
74
|
"c8": "^9.1.0",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"access": "public"
|
|
141
141
|
},
|
|
142
142
|
"typeCoverage": {
|
|
143
|
-
"atLeast": 84.
|
|
143
|
+
"atLeast": 84.92
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "303a9f20404106fe9c09befbd728ed7a20ccf7e0"
|
|
146
146
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="@agoric/ertp/exported" />
|
|
2
|
+
/// <reference types="@endo/pass-style" />
|
|
3
|
+
/// <reference path="../zoeService/utils.d.ts" />
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Any passable non-thenable. Often an explanatory string.
|
|
5
7
|
*/
|
|
6
|
-
type Completion =
|
|
8
|
+
type Completion = import('@endo/pass-style').Passable;
|
|
7
9
|
type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit;
|
|
8
10
|
|
|
9
11
|
type InvitationAmount = Amount<'set', InvitationDetails>;
|
|
@@ -62,7 +64,7 @@ type ZCF<CT extends unknown = Record<string, unknown>> = {
|
|
|
62
64
|
proposalShape?: Pattern,
|
|
63
65
|
) => Promise<Invitation<R, A>>;
|
|
64
66
|
shutdown: (completion: Completion) => void;
|
|
65
|
-
shutdownWithFailure: ShutdownWithFailure;
|
|
67
|
+
shutdownWithFailure: import('@agoric/swingset-vat').ShutdownWithFailure;
|
|
66
68
|
getZoeService: () => ERef<ZoeService>;
|
|
67
69
|
getInvitationIssuer: () => Issuer<'set'>;
|
|
68
70
|
getTerms: () => StandardTerms & CT;
|
|
@@ -73,7 +75,7 @@ type ZCF<CT extends unknown = Record<string, unknown>> = {
|
|
|
73
75
|
keyword: Keyword,
|
|
74
76
|
assetKind?: K_2 | undefined,
|
|
75
77
|
displayInfo?: AdditionalDisplayInfo,
|
|
76
|
-
options?: IssuerOptionsRecord,
|
|
78
|
+
options?: import('@agoric/ertp').IssuerOptionsRecord,
|
|
77
79
|
) => Promise<ZCFMint<K_2>>;
|
|
78
80
|
registerFeeMint: ZCFRegisterFeeMint;
|
|
79
81
|
makeEmptySeatKit: ZCFMakeEmptySeatKit;
|
|
@@ -216,8 +218,8 @@ type OfferHandler<OR extends unknown = unknown, OA = never> =
|
|
|
216
218
|
handle: HandleOffer<OR, OA>;
|
|
217
219
|
};
|
|
218
220
|
type ContractMeta = {
|
|
219
|
-
customTermsShape?: CopyRecord<any> | undefined;
|
|
220
|
-
privateArgsShape?: CopyRecord<any> | undefined;
|
|
221
|
+
customTermsShape?: import('@endo/pass-style').CopyRecord<any> | undefined;
|
|
222
|
+
privateArgsShape?: import('@endo/pass-style').CopyRecord<any> | undefined;
|
|
221
223
|
upgradability?: 'none' | 'canBeUpgraded' | 'canUpgrade' | undefined;
|
|
222
224
|
};
|
|
223
225
|
/**
|
|
@@ -238,8 +240,10 @@ type ContractStartFn<
|
|
|
238
240
|
type ContractStartFnResult<PF, CF> = {
|
|
239
241
|
publicFacet?: PF;
|
|
240
242
|
creatorFacet?: CF;
|
|
241
|
-
creatorInvitation?: Promise<Invitation<
|
|
243
|
+
creatorInvitation?: Promise<Invitation<any, any>> | undefined;
|
|
242
244
|
};
|
|
245
|
+
|
|
246
|
+
// XXX redef, losing documentation
|
|
243
247
|
type ContractOf<S> = import('../zoeService/utils').ContractOf<S>;
|
|
244
248
|
type AdminFacet = import('../zoeService/utils').AdminFacet<any>;
|
|
245
249
|
|
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
export type OracleContract =
|
|
1
|
+
export type OracleContract = {
|
|
2
|
+
terms: StandardTerms & Record<string, unknown>;
|
|
3
|
+
} & {
|
|
4
|
+
creatorFacet: {
|
|
5
|
+
initialize(privateParams: any): OracleCreatorFacet;
|
|
6
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
7
|
+
initialize(privateParams: any): OracleCreatorFacet;
|
|
8
|
+
}>;
|
|
9
|
+
publicFacet: {
|
|
10
|
+
/** @param {OracleQuery} query */
|
|
11
|
+
query(query: OracleQuery): Promise<unknown>;
|
|
12
|
+
/** @param {OracleQuery} query */
|
|
13
|
+
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
14
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
15
|
+
/** @param {OracleQuery} query */
|
|
16
|
+
query(query: OracleQuery): Promise<unknown>;
|
|
17
|
+
/** @param {OracleQuery} query */
|
|
18
|
+
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
2
21
|
export type OracleStart = typeof start;
|
|
22
|
+
/**
|
|
23
|
+
* @import {ContractOf} from '../zoeService/utils.js';
|
|
24
|
+
*/
|
|
3
25
|
/**
|
|
4
26
|
* This contract provides oracle queries for a fee or for free.
|
|
5
27
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["oracle.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["oracle.js"],"names":[],"mappings":";;;;;;;;;QAiEI,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;QAhBvB,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;;0BA6Bb,OAAO,KAAK;AAtG1B;;GAEG;AAEH;;;;GAIG;AACH,2BAFW,GAAG;;;;;;;QAkDV,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;QAhBvB,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;GAwB1B"}
|
package/src/contracts/oracle.js
CHANGED
|
@@ -6,6 +6,10 @@ import { AmountMath } from '@agoric/ertp';
|
|
|
6
6
|
import { E } from '@endo/eventual-send';
|
|
7
7
|
import { atomicTransfer } from '../contractSupport/index.js';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @import {ContractOf} from '../zoeService/utils.js';
|
|
11
|
+
*/
|
|
12
|
+
|
|
9
13
|
/**
|
|
10
14
|
* This contract provides oracle queries for a fee or for free.
|
|
11
15
|
*
|
|
@@ -3,7 +3,94 @@ export type OraclePriceSubmission = Readonly<ParsableNumber | {
|
|
|
3
3
|
data: ParsableNumber;
|
|
4
4
|
}>;
|
|
5
5
|
export type Price = ParsableNumber | Ratio;
|
|
6
|
-
export type PriceAggregatorContract =
|
|
6
|
+
export type PriceAggregatorContract = {
|
|
7
|
+
terms: StandardTerms & {
|
|
8
|
+
timer: import("@agoric/time").TimerService;
|
|
9
|
+
POLL_INTERVAL: bigint;
|
|
10
|
+
brandIn: globalThis.Brand<"nat">;
|
|
11
|
+
brandOut: globalThis.Brand<"nat">;
|
|
12
|
+
unitAmountIn: import("@agoric/ertp/exported.js").NatAmount;
|
|
13
|
+
};
|
|
14
|
+
privateArgs: {
|
|
15
|
+
marshaller: {
|
|
16
|
+
toCapData: import("@endo/marshal").ToCapData<unknown>;
|
|
17
|
+
fromCapData: import("@endo/marshal").FromCapData<unknown>;
|
|
18
|
+
serialize: import("@endo/marshal").ToCapData<unknown>;
|
|
19
|
+
unserialize: import("@endo/marshal").FromCapData<unknown>;
|
|
20
|
+
};
|
|
21
|
+
quoteMint?: globalThis.ERef<globalThis.Mint<"set", PriceDescription>> | undefined;
|
|
22
|
+
storageNode: globalThis.ERef<globalThis.StorageNode>;
|
|
23
|
+
};
|
|
24
|
+
} & {
|
|
25
|
+
creatorFacet: {
|
|
26
|
+
/**
|
|
27
|
+
* An "oracle invitation" is an invitation to be able to submit data to
|
|
28
|
+
* include in the priceAggregator's results.
|
|
29
|
+
*
|
|
30
|
+
* The offer result from this invitation is a OracleAdmin, which can be used
|
|
31
|
+
* directly to manage the price submissions as well as to terminate the
|
|
32
|
+
* relationship.
|
|
33
|
+
*
|
|
34
|
+
* @param {Instance | string} [oracleKey]
|
|
35
|
+
*/
|
|
36
|
+
makeOracleInvitation: (oracleKey?: string | Instance | undefined) => Promise<Invitation<{
|
|
37
|
+
admin: OracleAdmin<Price>;
|
|
38
|
+
invitationMakers: {
|
|
39
|
+
PushPrice: (price: ParsableNumber) => Promise<Invitation<void, undefined>>;
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
notifier?: globalThis.Notifier<OraclePriceSubmission> | undefined;
|
|
43
|
+
scaleValueOut?: number | undefined;
|
|
44
|
+
} | undefined>>;
|
|
45
|
+
/** @param {OracleKey} oracleKey */
|
|
46
|
+
deleteOracle: (oracleKey: OracleKey) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @param {Instance | string} [oracleInstance]
|
|
49
|
+
* @param {OracleQuery} [query]
|
|
50
|
+
* @returns {Promise<OracleAdmin<Price>>}
|
|
51
|
+
*/
|
|
52
|
+
initOracle: (oracleInstance?: string | Instance | undefined, query?: OracleQuery | undefined) => Promise<OracleAdmin<Price>>;
|
|
53
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
54
|
+
/**
|
|
55
|
+
* An "oracle invitation" is an invitation to be able to submit data to
|
|
56
|
+
* include in the priceAggregator's results.
|
|
57
|
+
*
|
|
58
|
+
* The offer result from this invitation is a OracleAdmin, which can be used
|
|
59
|
+
* directly to manage the price submissions as well as to terminate the
|
|
60
|
+
* relationship.
|
|
61
|
+
*
|
|
62
|
+
* @param {Instance | string} [oracleKey]
|
|
63
|
+
*/
|
|
64
|
+
makeOracleInvitation: (oracleKey?: string | Instance | undefined) => Promise<Invitation<{
|
|
65
|
+
admin: OracleAdmin<Price>;
|
|
66
|
+
invitationMakers: {
|
|
67
|
+
PushPrice: (price: ParsableNumber) => Promise<Invitation<void, undefined>>;
|
|
68
|
+
};
|
|
69
|
+
}, {
|
|
70
|
+
notifier?: globalThis.Notifier<OraclePriceSubmission> | undefined;
|
|
71
|
+
scaleValueOut?: number | undefined;
|
|
72
|
+
} | undefined>>;
|
|
73
|
+
/** @param {OracleKey} oracleKey */
|
|
74
|
+
deleteOracle: (oracleKey: OracleKey) => Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* @param {Instance | string} [oracleInstance]
|
|
77
|
+
* @param {OracleQuery} [query]
|
|
78
|
+
* @returns {Promise<OracleAdmin<Price>>}
|
|
79
|
+
*/
|
|
80
|
+
initOracle: (oracleInstance?: string | Instance | undefined, query?: OracleQuery | undefined) => Promise<OracleAdmin<Price>>;
|
|
81
|
+
}>;
|
|
82
|
+
publicFacet: {
|
|
83
|
+
getPriceAuthority(): import("@agoric/zoe/tools/types.js").PriceAuthority;
|
|
84
|
+
getSubscriber: () => globalThis.StoredSubscriber<unknown>;
|
|
85
|
+
/** Diagnostic tool */
|
|
86
|
+
getRoundCompleteNotifier(): Promise<globalThis.Notifier<any>>;
|
|
87
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
88
|
+
getPriceAuthority(): import("@agoric/zoe/tools/types.js").PriceAuthority;
|
|
89
|
+
getSubscriber: () => globalThis.StoredSubscriber<unknown>;
|
|
90
|
+
/** Diagnostic tool */
|
|
91
|
+
getRoundCompleteNotifier(): Promise<globalThis.Notifier<any>>;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
7
94
|
/**
|
|
8
95
|
* @deprecated use fluxAggregator
|
|
9
96
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceAggregator.d.ts","sourceRoot":"","sources":["priceAggregator.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"priceAggregator.d.ts","sourceRoot":"","sources":["priceAggregator.js"],"names":[],"mappings":"6BAqCc,MAAM,GAAG,MAAM,GAAG,MAAM;oCAEzB,QAAQ,CAAC,cAAc,GAAG;IAAE,IAAI,EAAE,cAA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;GAOzB;sCAplB4E,4BAA4B"}
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @import {LegacyMap} from '@agoric/store'
|
|
35
|
+
* @import {ContractOf} from '../zoeService/utils.js';
|
|
35
36
|
* @import {PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
36
37
|
*/
|
|
37
38
|
/** @typedef {bigint | number | string} ParsableNumber */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";cAKc,cAAc;uBACd,UAAU;gBACV,UAAU;gBACV,MAAM;;;;;qCAOT,UAAU,KACR,qBAAqB;;sBAKpB,CAAC,UAAU,EAAC,UAAU,KAAK,qBAAqB;;;sBAKhD,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI;eACpC,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO;;;cAKvC,QAAQ;kBACR,YAAY;;;;;+CAMf,UAAU,uBACV,mBAAmB,YACnB,cAAc,iBACd,aAAa,WACb,IAAI,CAAC,OAAO,CAAC,gBACb,IAAI,CAAC,OAAO,CAAC,WACb,OAAO,kBAAkB,EAAE,OAAO,KAChC,eAAe;sCAKjB,UAAU,KACR,IAAI;;uBAKH,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI;UAChC,gBAAgB;;;;;UAChB,OAAO,sBAAsB,EAAE,mBAAmB;uBAElD,MAAM,UAAU,CAAC,mBAAmB,CAAC;;oBAGtC,OAAO,eAAe,EAAE,eAAe,GAAG,mBAAmB;;wBAS5D,OAAO,CAAC,OAAO,eAAe,EAAE,QAAQ,CAAC;aACzC,OAAO;;;;;;;;2BASP,MAAM,IAAI;kBACV,CAAC,gBAAgB,EAAE,gBAAgB,EAChD,iBAAuB,EAA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AAO,EAAE,OAAO,KAAK,IAAI"}
|
package/src/internal-types.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
|
+
/// <reference types="@agoric/ertp/exported" />
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @typedef {object} SeatData
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
* @param {Keyword} keyword
|
|
164
165
|
* @param {AssetKind} [assetKind]
|
|
165
166
|
* @param {AdditionalDisplayInfo} [displayInfo]
|
|
166
|
-
* @param {IssuerOptionsRecord} [options]
|
|
167
|
+
* @param {import('@agoric/ertp').IssuerOptionsRecord} [options]
|
|
167
168
|
* @returns {ZoeMint}
|
|
168
169
|
*/
|
|
169
170
|
|
package/src/types-ambient.js
CHANGED
|
@@ -66,7 +66,7 @@ export const makeStartInstance = (
|
|
|
66
66
|
adminNode: M.remotable('adminNode'),
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
/** @type {import('@agoric/swingset-liveslots').PromiseWatcher<
|
|
69
|
+
/** @type {import('@agoric/swingset-liveslots').PromiseWatcher<Completion, [InstanceAdmin, Handle<'adminNode'>]>} */
|
|
70
70
|
const watcher = prepareExo(
|
|
71
71
|
zoeBaggage,
|
|
72
72
|
'InstanceCompletionWatcher',
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
// Ambient types
|
|
2
|
+
import '../types-ambient.js';
|
|
3
|
+
import '../contractFacet/types-ambient.js';
|
|
4
|
+
|
|
1
5
|
import type { Issuer } from '@agoric/ertp/exported.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Callable } from '@agoric/internal/src/utils.js';
|
|
6
|
+
import type { TagContainer } from '@agoric/internal/src/tagged.js';
|
|
4
7
|
import type { Baggage } from '@agoric/swingset-liveslots';
|
|
5
8
|
import type { VatUpgradeResults } from '@agoric/swingset-vat';
|
|
6
9
|
import type { RemotableObject } from '@endo/marshal';
|
|
@@ -8,25 +11,18 @@ import type { RemotableObject } from '@endo/marshal';
|
|
|
8
11
|
// XXX https://github.com/Agoric/agoric-sdk/issues/4565
|
|
9
12
|
type SourceBundle = Record<string, any>;
|
|
10
13
|
|
|
11
|
-
type ContractFacet<T extends {} = {}> = {
|
|
12
|
-
readonly [P in keyof T]: T[P] extends Callable ? T[P] : never;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
14
|
/**
|
|
16
15
|
* Installation of a contract, typed by its start function.
|
|
17
16
|
*/
|
|
18
17
|
export type Installation<SF extends ContractStartFunction | unknown> =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'StartFunction',
|
|
26
|
-
SF
|
|
27
|
-
>;
|
|
18
|
+
TagContainer<SF> &
|
|
19
|
+
RemotableObject & {
|
|
20
|
+
getBundle: () => SourceBundle;
|
|
21
|
+
getBundleLabel: () => string;
|
|
22
|
+
};
|
|
23
|
+
|
|
28
24
|
export type Instance<SF extends ContractStartFunction | unknown> =
|
|
29
|
-
RemotableObject &
|
|
25
|
+
TagContainer<SF> & RemotableObject & Handle<'Instance'>;
|
|
30
26
|
|
|
31
27
|
export type InstallationStart<I> =
|
|
32
28
|
I extends Installation<infer SF> ? SF : never;
|
|
@@ -51,41 +47,30 @@ export type AdminFacet<SF extends ContractStartFunction> = RemotableObject & {
|
|
|
51
47
|
: (newPrivateArgs: Parameters<SF>[1]) => Promise<VatUpgradeResults>;
|
|
52
48
|
};
|
|
53
49
|
|
|
54
|
-
type StartParams<SF> = SF extends ContractStartFunction
|
|
50
|
+
export type StartParams<SF> = SF extends ContractStartFunction
|
|
55
51
|
? Parameters<SF>[1] extends undefined
|
|
56
52
|
? {
|
|
57
|
-
terms: ReturnType<
|
|
53
|
+
terms: ReturnType<ZcfOf<SF>['getTerms']>;
|
|
58
54
|
}
|
|
59
55
|
: {
|
|
60
|
-
terms: ReturnType<
|
|
56
|
+
terms: ReturnType<ZcfOf<SF>['getTerms']>;
|
|
61
57
|
privateArgs: Parameters<SF>[1];
|
|
62
58
|
}
|
|
63
59
|
: never;
|
|
64
60
|
|
|
65
|
-
type StartResult<S
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
type StartResult<S extends (...args: any) => any> = Awaited<ReturnType<S>>;
|
|
62
|
+
type ZcfOf<SF extends ContractStartFunction> = Parameters<SF>[0] extends ZCF
|
|
63
|
+
? Parameters<SF>[0]
|
|
64
|
+
: ZCF<any>;
|
|
68
65
|
|
|
69
66
|
/**
|
|
70
67
|
* Convenience record for contract start function, merging its result with params.
|
|
71
68
|
*/
|
|
72
|
-
export type ContractOf<S> = StartParams<S> &
|
|
73
|
-
|
|
74
|
-
type StartContractInstance<C> = (
|
|
75
|
-
installation: Installation<C>,
|
|
76
|
-
issuerKeywordRecord?: Record<string, Issuer<any>>,
|
|
77
|
-
terms?: object,
|
|
78
|
-
privateArgs?: object,
|
|
79
|
-
) => Promise<{
|
|
80
|
-
creatorFacet: C['creatorFacet'];
|
|
81
|
-
publicFacet: C['publicFacet'];
|
|
82
|
-
instance: Instance;
|
|
83
|
-
creatorInvitation: C['creatorInvitation'];
|
|
84
|
-
adminFacet: AdminFacet<any>;
|
|
85
|
-
}>;
|
|
69
|
+
export type ContractOf<S extends (...args: any) => any> = StartParams<S> &
|
|
70
|
+
StartResult<S>;
|
|
86
71
|
|
|
87
72
|
/** The result of `startInstance` */
|
|
88
|
-
export type StartedInstanceKit<SF> = {
|
|
73
|
+
export type StartedInstanceKit<SF extends ContractStartFunction> = {
|
|
89
74
|
instance: Instance<SF>;
|
|
90
75
|
adminFacet: AdminFacet<SF>;
|
|
91
76
|
// theses are empty by default. the return type will override
|
|
@@ -113,6 +98,7 @@ export type StartedInstanceKit<SF> = {
|
|
|
113
98
|
* the creator facet, public facet, and creator invitation as defined
|
|
114
99
|
* by the contract.
|
|
115
100
|
*/
|
|
101
|
+
// XXX SF should extend ContractStartFunction but doing that triggers a bunch of tech debt type errors
|
|
116
102
|
export type StartInstance = <SF>(
|
|
117
103
|
installation: Installation<SF> | PromiseLike<Installation<SF>>,
|
|
118
104
|
issuerKeywordRecord?: Record<Keyword, Issuer<any>>,
|
|
@@ -122,6 +108,7 @@ export type StartInstance = <SF>(
|
|
|
122
108
|
label?: string,
|
|
123
109
|
) => Promise<StartedInstanceKit<SF>>;
|
|
124
110
|
|
|
111
|
+
// XXX SF should extend ContractStartFunction but doing that triggers a bunch of tech debt type errors
|
|
125
112
|
export type GetPublicFacet = <SF>(
|
|
126
113
|
instance: Instance<SF> | PromiseLike<Instance<SF>>,
|
|
127
114
|
) => Promise<StartResult<SF>['publicFacet']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoe.d.ts","sourceRoot":"","sources":["zoe.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoe.d.ts","sourceRoot":"","sources":["zoe.js"],"names":[],"mappings":"qBAiSa,UAAU,CAAC,OAAO,iBAAiB,CAAC;AA/PjD;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;IA6MI,4BAA4B;mBAAjB,aAAa;;EAK3B;AAED;;;;;;;;;;;;;;;GAeG;AACH;;;;;IAvBI,4BAA4B;mBAAjB,aAAa;;EA8BxB;6BA7PuB,kBAAkB"}
|
package/src/zoeService/zoe.js
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* validate that.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
/// <reference types="@agoric/internal/exported" />
|
|
15
|
+
/// <reference types="@agoric/notifier/exported.js" />
|
|
14
16
|
/// <reference path="../internal-types.js" />
|
|
15
17
|
|
|
16
18
|
import { E } from '@endo/eventual-send';
|
|
@@ -26,10 +28,6 @@ import { getZcfBundleCap } from './createZCFVat.js';
|
|
|
26
28
|
import { defaultFeeIssuerConfig, prepareFeeMint } from './feeMint.js';
|
|
27
29
|
import { ZoeServiceI } from '../typeGuards.js';
|
|
28
30
|
|
|
29
|
-
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
|
|
30
|
-
import '@agoric/internal/exported.js';
|
|
31
|
-
import '@agoric/notifier/exported.js';
|
|
32
|
-
|
|
33
31
|
/** @import {Baggage} from '@agoric/vat-data' */
|
|
34
32
|
|
|
35
33
|
const { Fail } = assert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;
|
|
1
|
+
{"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;qBAiCH,WACP;mCAIib,WAAW;;;;;;GADlc"}
|