@agoric/inter-protocol 0.16.2-dev-fdb7004.0 → 0.16.2-dev-c42dff3.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/package.json +15 -15
- package/src/econCommitteeCharter.d.ts +4 -3
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +1 -1
- package/src/price/fluxAggregatorContract.d.ts +1 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +2 -0
- package/src/proposals/add-auction.d.ts +3 -3
- package/src/proposals/add-auction.d.ts.map +1 -1
- package/src/proposals/add-auction.js +3 -3
- package/src/proposals/addAssetToVault.d.ts +14 -1
- package/src/proposals/addAssetToVault.d.ts.map +1 -1
- package/src/proposals/addAssetToVault.js +20 -2
- package/src/proposals/deploy-price-feeds.d.ts +76 -0
- package/src/proposals/deploy-price-feeds.d.ts.map +1 -0
- package/src/proposals/deploy-price-feeds.js +312 -0
- package/src/proposals/price-feed-proposal.d.ts.map +1 -1
- package/src/proposals/price-feed-proposal.js +2 -1
- package/src/proposals/replace-scaledPriceAuthorities.d.ts +30 -0
- package/src/proposals/replace-scaledPriceAuthorities.d.ts.map +1 -0
- package/src/proposals/replace-scaledPriceAuthorities.js +124 -0
- package/src/proposals/upgrade-vaults.d.ts +3 -1
- package/src/proposals/upgrade-vaults.d.ts.map +1 -1
- package/src/proposals/upgrade-vaults.js +28 -40
- package/src/proposals/utils.d.ts +2 -0
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +8 -0
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.16.2-dev-
|
|
3
|
+
"version": "0.16.2-dev-c42dff3.0+c42dff3",
|
|
4
4
|
"description": "Core cryptoeconomy contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
35
|
-
"@agoric/governance": "0.10.4-dev-
|
|
36
|
-
"@agoric/internal": "0.3.3-dev-
|
|
37
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
38
|
-
"@agoric/store": "0.9.3-dev-
|
|
39
|
-
"@agoric/time": "0.3.3-dev-
|
|
40
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
41
|
-
"@agoric/vats": "0.15.2-dev-
|
|
42
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
34
|
+
"@agoric/ertp": "0.16.3-dev-c42dff3.0+c42dff3",
|
|
35
|
+
"@agoric/governance": "0.10.4-dev-c42dff3.0+c42dff3",
|
|
36
|
+
"@agoric/internal": "0.3.3-dev-c42dff3.0+c42dff3",
|
|
37
|
+
"@agoric/notifier": "0.6.3-dev-c42dff3.0+c42dff3",
|
|
38
|
+
"@agoric/store": "0.9.3-dev-c42dff3.0+c42dff3",
|
|
39
|
+
"@agoric/time": "0.3.3-dev-c42dff3.0+c42dff3",
|
|
40
|
+
"@agoric/vat-data": "0.5.3-dev-c42dff3.0+c42dff3",
|
|
41
|
+
"@agoric/vats": "0.15.2-dev-c42dff3.0+c42dff3",
|
|
42
|
+
"@agoric/zoe": "0.26.3-dev-c42dff3.0+c42dff3",
|
|
43
43
|
"@endo/captp": "^4.3.0",
|
|
44
44
|
"@endo/errors": "^1.2.5",
|
|
45
45
|
"@endo/eventual-send": "^1.2.5",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"jessie.js": "^0.3.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
54
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
55
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
56
|
-
"@agoric/zone": "0.2.3-dev-
|
|
53
|
+
"@agoric/smart-wallet": "0.5.4-dev-c42dff3.0+c42dff3",
|
|
54
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-c42dff3.0+c42dff3",
|
|
55
|
+
"@agoric/swingset-vat": "0.32.3-dev-c42dff3.0+c42dff3",
|
|
56
|
+
"@agoric/zone": "0.2.3-dev-c42dff3.0+c42dff3",
|
|
57
57
|
"@endo/bundle-source": "^3.4.0",
|
|
58
58
|
"@endo/init": "^1.1.4",
|
|
59
59
|
"@endo/promise-kit": "^1.1.5",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typeCoverage": {
|
|
85
85
|
"atLeast": 95.8
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "c42dff304b9c094090d9f889e58b15573d5258ec"
|
|
88
88
|
}
|
|
@@ -30,10 +30,11 @@ export type ParamChangesOfferArgs = {
|
|
|
30
30
|
deadline: bigint;
|
|
31
31
|
instance: Instance;
|
|
32
32
|
params: Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* paramPath is determined by contract
|
|
35
|
+
*/
|
|
33
36
|
path?: {
|
|
34
|
-
paramPath:
|
|
35
|
-
key: string;
|
|
36
|
-
};
|
|
37
|
+
paramPath: unknown;
|
|
37
38
|
} | undefined;
|
|
38
39
|
};
|
|
39
40
|
//# sourceMappingURL=econCommitteeCharter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"econCommitteeCharter.d.ts","sourceRoot":"","sources":["econCommitteeCharter.js"],"names":[],"mappings":"AAaA;;;;;GAKG;AAEH,iEAAkE;AAoBlE,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAMnC;AAQK,2BAJI,GAAG,CAAC;IAAE,6BAA6B,EAAE,YAAY,CAAA;CAAE,CAAC,eACpD,SAAS,WACT,OAAO,kBAAkB,EAAE,OAAO;;QAsHvC;;;;WAIG;wCAHQ,QAAQ,iBACR,oBAAoB,CAAC,GAAG,CAAC;;;;;0CAxE7B,QAAQ,cACR,MAAM,cACN,MAAM,EAAE,YACR,OAAO,cAAc,EAAE,cAAc;;;;GAkFjD;;cAjKa,MAAM;cACN,QAAQ;YACR,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"econCommitteeCharter.d.ts","sourceRoot":"","sources":["econCommitteeCharter.js"],"names":[],"mappings":"AAaA;;;;;GAKG;AAEH,iEAAkE;AAoBlE,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAMnC;AAQK,2BAJI,GAAG,CAAC;IAAE,6BAA6B,EAAE,YAAY,CAAA;CAAE,CAAC,eACpD,SAAS,WACT,OAAO,kBAAkB,EAAE,OAAO;;QAsHvC;;;;WAIG;wCAHQ,QAAQ,iBACR,oBAAoB,CAAC,GAAG,CAAC;;;;;0CAxE7B,QAAQ,cACR,MAAM,cACN,MAAM,EAAE,YACR,OAAO,cAAc,EAAE,cAAc;;;;GAkFjD;;cAjKa,MAAM;cACN,QAAQ;YACR,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;mBACV,OAAO"}
|
|
@@ -25,7 +25,7 @@ export const INVITATION_MAKERS_DESC = 'charter member invitation';
|
|
|
25
25
|
* @property {bigint} deadline
|
|
26
26
|
* @property {Instance} instance
|
|
27
27
|
* @property {Record<string, unknown>} params
|
|
28
|
-
* @property {{ paramPath:
|
|
28
|
+
* @property {{ paramPath: unknown }} [path] paramPath is determined by contract
|
|
29
29
|
*/
|
|
30
30
|
const ParamChangesOfferArgsShape = M.splitRecord(
|
|
31
31
|
{
|
|
@@ -65,6 +65,7 @@ export function start(zcf: ZCF<import("./fluxAggregatorKit.js").ChainlinkConfig
|
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
}>;
|
|
68
|
+
export type FluxStartFn = typeof start;
|
|
68
69
|
import type { TimerService } from '@agoric/time';
|
|
69
70
|
import type { Baggage } from '@agoric/vat-data';
|
|
70
71
|
//# sourceMappingURL=fluxAggregatorContract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluxAggregatorContract.d.ts","sourceRoot":"","sources":["fluxAggregatorContract.js"],"names":[],"mappings":"AAcA;;;GAGG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAmBrB;AA0BK,2BAlBI,GAAG,CACb,OAAW,wBAAwB,EAAE,eAAe,GAAG;IACjD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CAC9B,CACF,eACO;IACN,0BAA0B,CAAC,EAAE,OAAO,0CAA0C,EAAE,sBAAsB,CAAC;IACvG,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,mBAAmB,EAAE,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,CAAC;IAC5D,WAAW,EAAE,WAAW,CAAC;CAC1B,WACO,OAAO;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"fluxAggregatorContract.d.ts","sourceRoot":"","sources":["fluxAggregatorContract.js"],"names":[],"mappings":"AAcA;;;GAGG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAmBrB;AA0BK,2BAlBI,GAAG,CACb,OAAW,wBAAwB,EAAE,eAAe,GAAG;IACjD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CAC9B,CACF,eACO;IACN,0BAA0B,CAAC,EAAE,OAAO,0CAA0C,EAAE,sBAAsB,CAAC;IACvG,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,mBAAmB,EAAE,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,CAAC;IAC5D,WAAW,EAAE,WAAW,CAAC;CAC1B,WACO,OAAO;;;;;;;;;;;;;;;6CAyI8vF,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAJnyF;0BAGa,OAAO,KAAK;kCAtLK,cAAc;6BADnB,kBAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, econCharterKit,
|
|
1
|
+
export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, econCharterKit, priceAuthority8400, zoe, }, produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance }, instance: { consume: { reserve: reserveInstance }, produce: { auctioneer: auctionInstance }, }, installation: { consume: { contractGovernor: contractGovernorInstallation }, produce: { auctioneer: produceInstallation }, }, issuer: { consume: { [Stable.symbol]: stableIssuerP }, }, }: import("./econ-behaviors.js").EconomyBootstrapPowers & interlockPowers, { options }: {
|
|
2
2
|
options: {
|
|
3
3
|
auctionsRef: {
|
|
4
4
|
bundleID: string;
|
|
@@ -15,7 +15,7 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
15
15
|
chainTimerService: boolean;
|
|
16
16
|
econCharterKit: boolean;
|
|
17
17
|
economicCommitteeCreatorFacet: boolean;
|
|
18
|
-
|
|
18
|
+
priceAuthority8400: boolean;
|
|
19
19
|
zoe: boolean;
|
|
20
20
|
};
|
|
21
21
|
produce: {
|
|
@@ -56,7 +56,7 @@ export function getManifestForAddAuction(_ign: object, addAuctionOptions: any):
|
|
|
56
56
|
chainTimerService: boolean;
|
|
57
57
|
econCharterKit: boolean;
|
|
58
58
|
economicCommitteeCreatorFacet: boolean;
|
|
59
|
-
|
|
59
|
+
priceAuthority8400: boolean;
|
|
60
60
|
zoe: boolean;
|
|
61
61
|
};
|
|
62
62
|
produce: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"AAmBO,
|
|
1
|
+
{"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"AAmBO,wkBAJI,OAAO,qBAAqB,EAAE,sBAAsB,GAC1D,eAAe,eACT;IAAE,OAAO,EAAE;QAAE,WAAW,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,iBA0K5D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BG;AAQI,+CAHI,MAAM,qBACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOb;8BAhOY,cAAc,CAAC;IACvB,yBAAyB,EAAE,QAAQ,CAAC;CACrC,CAAC;uBARkB,gCAAgC"}
|
|
@@ -27,7 +27,7 @@ export const addAuction = async (
|
|
|
27
27
|
chainTimerService,
|
|
28
28
|
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
29
29
|
econCharterKit,
|
|
30
|
-
|
|
30
|
+
priceAuthority8400,
|
|
31
31
|
zoe,
|
|
32
32
|
},
|
|
33
33
|
produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance },
|
|
@@ -95,7 +95,7 @@ export const addAuction = async (
|
|
|
95
95
|
const auctionTerms = makeGovernedATerms(
|
|
96
96
|
{ storageNode, marshaller },
|
|
97
97
|
chainTimerService,
|
|
98
|
-
|
|
98
|
+
priceAuthority8400,
|
|
99
99
|
reservePublicFacet,
|
|
100
100
|
{
|
|
101
101
|
...params,
|
|
@@ -197,7 +197,7 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
197
197
|
chainTimerService: true,
|
|
198
198
|
econCharterKit: true,
|
|
199
199
|
economicCommitteeCreatorFacet: true,
|
|
200
|
-
|
|
200
|
+
priceAuthority8400: true,
|
|
201
201
|
zoe: true,
|
|
202
202
|
},
|
|
203
203
|
produce: {
|
|
@@ -9,10 +9,23 @@ export function publishInterchainAssetFromBank({ consume: { bankManager, agoricN
|
|
|
9
9
|
interchainAssetOptions: InterchainAssetOptions;
|
|
10
10
|
};
|
|
11
11
|
}): Promise<void>;
|
|
12
|
-
export function
|
|
12
|
+
export function startScaledPriceAuthority({ consume: { agoricNamesAdmin, startUpgradable, priceAuthorityAdmin, priceAuthority, }, }: BootstrapPowers, { options: { interchainAssetOptions } }: {
|
|
13
13
|
options: {
|
|
14
14
|
interchainAssetOptions: InterchainAssetOptions;
|
|
15
15
|
};
|
|
16
|
+
}): Promise<{
|
|
17
|
+
instance: import("@agoric/zoe/src/zoeService/utils.js").Instance<import("@agoric/zoe/src/zoeService/utils.js").ContractStartFunction>;
|
|
18
|
+
adminFacet: import("@agoric/zoe/src/zoeService/utils.js").AdminFacet<import("@agoric/zoe/src/zoeService/utils.js").ContractStartFunction>;
|
|
19
|
+
creatorFacet: {};
|
|
20
|
+
publicFacet: {};
|
|
21
|
+
} & {
|
|
22
|
+
creatorFacet?: {};
|
|
23
|
+
publicFacet?: {};
|
|
24
|
+
} & {
|
|
25
|
+
label: string;
|
|
26
|
+
}>;
|
|
27
|
+
export function registerScaledPriceAuthority(powers: BootstrapPowers, { options }: {
|
|
28
|
+
options: object;
|
|
16
29
|
}): Promise<void>;
|
|
17
30
|
export function addAssetToVault({ consume: { vaultFactoryKit, agoricNamesAdmin, auctioneerKit, chainTimerService, }, brand: { consume: { [Stable.symbol]: stableP }, }, instance: { consume: consumeInstance }, }: EconomyBootstrapPowers, { options: { debtLimitValue, interestRateValue, interchainAssetOptions, }, }: {
|
|
18
31
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAssetToVault.d.ts","sourceRoot":"","sources":["addAssetToVault.js"],"names":[],"mappings":";AA4CO,4FALI,eAAe,2CAEvB;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,yBAsBA;AAQM,yKALI,sBAAsB,2CAE9B;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,iBAmDA;AAQM,
|
|
1
|
+
{"version":3,"file":"addAssetToVault.d.ts","sourceRoot":"","sources":["addAssetToVault.js"],"names":[],"mappings":";AA4CO,4FALI,eAAe,2CAEvB;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,yBAsBA;AAQM,yKALI,sBAAsB,2CAE9B;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,iBAmDA;AAQM,qIALI,eAAe,2CAEvB;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA;;;;;;;;;;GAuGA;AAOM,qDAJI,eAAe,eAEvB;IAAuB,OAAO,EAAtB,MAAM;CAChB,iBAgBA;AA+EM,mNAPI,sBAAsB,gFAE9B;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;QACmB,cAAc,EAAvD,MAAM,GAAG,MAAM,GAAG,MAAM;QACD,iBAAiB,EAAxC,MAAM;KAChB;CAAA,iBAyEA;AAEM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8EN;;;;;;;;aA1ca,MAAM;;;;;;;;;;;;;;;;4CAQsB,qBAAqB;uBAzBxC,gCAAgC"}
|
|
@@ -129,7 +129,7 @@ export const publishInterchainAssetFromBank = async (
|
|
|
129
129
|
* @param {object} config.options
|
|
130
130
|
* @param {InterchainAssetOptions} config.options.interchainAssetOptions
|
|
131
131
|
*/
|
|
132
|
-
export const
|
|
132
|
+
export const startScaledPriceAuthority = async (
|
|
133
133
|
{
|
|
134
134
|
consume: {
|
|
135
135
|
agoricNamesAdmin,
|
|
@@ -137,7 +137,6 @@ export const registerScaledPriceAuthority = async (
|
|
|
137
137
|
priceAuthorityAdmin,
|
|
138
138
|
priceAuthority,
|
|
139
139
|
},
|
|
140
|
-
instance: { produce: produceInstance },
|
|
141
140
|
},
|
|
142
141
|
{ options: { interchainAssetOptions } },
|
|
143
142
|
) => {
|
|
@@ -231,6 +230,25 @@ export const registerScaledPriceAuthority = async (
|
|
|
231
230
|
true, // force
|
|
232
231
|
);
|
|
233
232
|
|
|
233
|
+
return spaKit;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @param {BootstrapPowers} powers
|
|
238
|
+
* @param {object} config
|
|
239
|
+
* @param {object} config.options
|
|
240
|
+
*/
|
|
241
|
+
export const registerScaledPriceAuthority = async (powers, { options }) => {
|
|
242
|
+
const {
|
|
243
|
+
instance: { produce: produceInstance },
|
|
244
|
+
} = powers;
|
|
245
|
+
|
|
246
|
+
const { keyword, issuerName = keyword } = options.interchainAssetOptions;
|
|
247
|
+
|
|
248
|
+
const spaKit = await startScaledPriceAuthority(powers, { options });
|
|
249
|
+
|
|
250
|
+
const label = scaledPriceFeedName(issuerName);
|
|
251
|
+
|
|
234
252
|
// publish into agoricNames so that others can await its presence.
|
|
235
253
|
// This must stay after registerPriceAuthority above so it's evidence of registration.
|
|
236
254
|
// eslint-disable-next-line no-restricted-syntax -- computed property
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** @type {ChainlinkConfig} */
|
|
2
|
+
export const DEFAULT_CONTRACT_TERMS: ChainlinkConfig;
|
|
3
|
+
export function ensureOracleBrand({ namedVat: { consume: { agoricNames }, }, oracleBrand: { produce: oracleBrandProduce }, }: EconomyBootstrapPowers & NamedVatPowers, { name, decimalPlaces }: {
|
|
4
|
+
name: string;
|
|
5
|
+
decimalPlaces: number;
|
|
6
|
+
}): Promise<Brand<"nat">>;
|
|
7
|
+
export function deployPriceFeeds(powers: EconomyBootstrapPowers & NamedVatPowers, config: {
|
|
8
|
+
options: PriceFeedConfig & {
|
|
9
|
+
priceAggregatorRef: {
|
|
10
|
+
bundleID: string;
|
|
11
|
+
};
|
|
12
|
+
scaledPARef: {
|
|
13
|
+
bundleID: string;
|
|
14
|
+
};
|
|
15
|
+
inBrandsDecimals?: number;
|
|
16
|
+
contractTerms?: ChainlinkConfig;
|
|
17
|
+
outBrandName?: string;
|
|
18
|
+
outBrandDecimals?: number;
|
|
19
|
+
};
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
export function getManifestForPriceFeeds({ restoreRef: _restoreRef }: {
|
|
22
|
+
restoreRef: any;
|
|
23
|
+
}, priceFeedOptions: PriceFeedConfig & {
|
|
24
|
+
priceAggregatorRef: any;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
manifest: {
|
|
27
|
+
[x: string]: {
|
|
28
|
+
namedVat: string;
|
|
29
|
+
consume: {
|
|
30
|
+
agoricNamesAdmin: string;
|
|
31
|
+
agoricNames: string;
|
|
32
|
+
board: string;
|
|
33
|
+
chainStorage: string;
|
|
34
|
+
chainTimerService: string;
|
|
35
|
+
contractKits: string;
|
|
36
|
+
econCharterKit: string;
|
|
37
|
+
highPrioritySendersManager: string;
|
|
38
|
+
instancePrivateArgs: string;
|
|
39
|
+
namesByAddressAdmin: string;
|
|
40
|
+
priceAuthority: string;
|
|
41
|
+
priceAuthorityAdmin: string;
|
|
42
|
+
startGovernedUpgradable: string;
|
|
43
|
+
startUpgradable: string;
|
|
44
|
+
zoe: string;
|
|
45
|
+
};
|
|
46
|
+
installation: {
|
|
47
|
+
produce: {
|
|
48
|
+
priceAggregator: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
instance: {
|
|
52
|
+
produce: string;
|
|
53
|
+
};
|
|
54
|
+
oracleBrand: {
|
|
55
|
+
produce: string;
|
|
56
|
+
};
|
|
57
|
+
produce: {
|
|
58
|
+
priceAuthority8400: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
options: {
|
|
63
|
+
oracleAddresses: string[];
|
|
64
|
+
inBrandNames: string[];
|
|
65
|
+
contractTerms?: Partial<ChainlinkConfig>;
|
|
66
|
+
priceAggregatorRef: any;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
export type PriceFeedConfig = {
|
|
70
|
+
oracleAddresses: string[];
|
|
71
|
+
inBrandNames: string[];
|
|
72
|
+
contractTerms?: Partial<ChainlinkConfig>;
|
|
73
|
+
};
|
|
74
|
+
import type { ChainlinkConfig } from '@agoric/inter-protocol/src/price/fluxAggregatorKit.js';
|
|
75
|
+
import type { EconomyBootstrapPowers } from './econ-behaviors.js';
|
|
76
|
+
//# sourceMappingURL=deploy-price-feeds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-price-feeds.d.ts","sourceRoot":"","sources":["deploy-price-feeds.js"],"names":[],"mappings":"AAcA,8BAA8B;AAC9B,qCADW,eAAe,CAQxB;AA4CK,8HAJI,sBAAsB,GAAG,cAAc,2BACvC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAmBjC;AA0HM,yCAZI,sBAAsB,GAAG,cAAc,UACvC;IACN,OAAO,EAAE,eAAe,GAAG;QACzB,kBAAkB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QACzC,WAAW,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,aAAa,CAAC,EAAE,eAAe,CAAC;QAChC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH,iBAgEH;AAWM,sEAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,oBAAQ,eAAe,GAAG;IAAE,kBAAkB,EAAE,GAAG,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApPlC,MAAM,EAAE;sBACX,MAAM,EAAE;wBACN,OAAO,CAAC,eAAe,CAAC;4BAkPM,GAAG;;GAmCpD;8BAxRW;IACR,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C;qCAV+B,uDAAuD;4CADhD,qBAAqB"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { makeTracer } from '@agoric/internal';
|
|
2
|
+
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
|
+
import { E } from '@endo/far';
|
|
4
|
+
|
|
5
|
+
import { unitAmount } from '@agoric/zoe/src/contractSupport/priceQuote.js';
|
|
6
|
+
import {
|
|
7
|
+
oracleBrandFeedName,
|
|
8
|
+
reserveThenDeposit,
|
|
9
|
+
sanitizePathSegment,
|
|
10
|
+
} from './utils.js';
|
|
11
|
+
import { replaceScaledPriceAuthorities } from './replace-scaledPriceAuthorities.js';
|
|
12
|
+
|
|
13
|
+
const STORAGE_PATH = 'priceFeed';
|
|
14
|
+
|
|
15
|
+
/** @type {ChainlinkConfig} */
|
|
16
|
+
export const DEFAULT_CONTRACT_TERMS = {
|
|
17
|
+
maxSubmissionCount: 1000,
|
|
18
|
+
minSubmissionCount: 2,
|
|
19
|
+
restartDelay: 1n, // the number of rounds an Oracle has to wait before they can initiate another round
|
|
20
|
+
timeout: 10, // in seconds according to chainTimerService
|
|
21
|
+
minSubmissionValue: 1,
|
|
22
|
+
maxSubmissionValue: 2 ** 256,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @import {EconomyBootstrapPowers} from './econ-behaviors.js'; */
|
|
26
|
+
/** @import {ChainlinkConfig} from '@agoric/inter-protocol/src/price/fluxAggregatorKit.js'; */
|
|
27
|
+
/** @import {FluxStartFn} from '@agoric/inter-protocol/src/price/fluxAggregatorContract.js'; */
|
|
28
|
+
|
|
29
|
+
const trace = makeTracer('DeployPriceFeed', true);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {{
|
|
33
|
+
* oracleAddresses: string[];
|
|
34
|
+
* inBrandNames: string[];
|
|
35
|
+
* contractTerms?: Partial<ChainlinkConfig>;
|
|
36
|
+
* }} PriceFeedConfig
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param {EconomyBootstrapPowers} powers
|
|
41
|
+
* @param {string} bundleID
|
|
42
|
+
*/
|
|
43
|
+
const installPriceAggregator = async (
|
|
44
|
+
{
|
|
45
|
+
consume: { zoe },
|
|
46
|
+
installation: {
|
|
47
|
+
produce: { priceAggregator },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
bundleID,
|
|
51
|
+
) => {
|
|
52
|
+
/** @type {Installation<FluxStartFn>} */
|
|
53
|
+
const installation = await E(zoe).installBundleID(bundleID);
|
|
54
|
+
priceAggregator.reset();
|
|
55
|
+
priceAggregator.resolve(installation);
|
|
56
|
+
trace('installed priceAggregator', bundleID.slice(0, 'b1-1234567'.length));
|
|
57
|
+
return installation;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Provide (find/create) inert brands (no mint or issuer) referred to by oracles
|
|
62
|
+
*
|
|
63
|
+
* @param {EconomyBootstrapPowers & NamedVatPowers} space
|
|
64
|
+
* @param {{ name: string; decimalPlaces: number }} opt
|
|
65
|
+
* @returns {Promise<Brand<'nat'>>}
|
|
66
|
+
*/
|
|
67
|
+
export const ensureOracleBrand = async (
|
|
68
|
+
{
|
|
69
|
+
namedVat: {
|
|
70
|
+
consume: { agoricNames },
|
|
71
|
+
},
|
|
72
|
+
oracleBrand: { produce: oracleBrandProduce },
|
|
73
|
+
},
|
|
74
|
+
{ name, decimalPlaces },
|
|
75
|
+
) => {
|
|
76
|
+
const brand = E(agoricNames).provideInertBrand(name, {
|
|
77
|
+
assetKind: 'nat',
|
|
78
|
+
decimalPlaces,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
oracleBrandProduce[name].reset();
|
|
82
|
+
oracleBrandProduce[name].resolve(brand);
|
|
83
|
+
return brand;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @param {EconomyBootstrapPowers} powers
|
|
88
|
+
* @param {{
|
|
89
|
+
* AGORIC_INSTANCE_NAME: string;
|
|
90
|
+
* contractTerms: import('@agoric/inter-protocol/src/price/fluxAggregatorKit.js').ChainlinkConfig;
|
|
91
|
+
* brandIn: Brand<'nat'>;
|
|
92
|
+
* brandOut: Brand<'nat'>;
|
|
93
|
+
* }} config
|
|
94
|
+
* @param {Installation<FluxStartFn>} installation
|
|
95
|
+
*/
|
|
96
|
+
const startPriceAggregatorInstance = async (
|
|
97
|
+
{
|
|
98
|
+
consume: {
|
|
99
|
+
board,
|
|
100
|
+
chainStorage,
|
|
101
|
+
chainTimerService,
|
|
102
|
+
econCharterKit,
|
|
103
|
+
highPrioritySendersManager,
|
|
104
|
+
namesByAddressAdmin,
|
|
105
|
+
startGovernedUpgradable,
|
|
106
|
+
},
|
|
107
|
+
instance: { produce: produceInstance },
|
|
108
|
+
},
|
|
109
|
+
{ AGORIC_INSTANCE_NAME, contractTerms, brandIn, brandOut },
|
|
110
|
+
installation,
|
|
111
|
+
) => {
|
|
112
|
+
trace('startPriceAggregatorInstance', AGORIC_INSTANCE_NAME);
|
|
113
|
+
const label = sanitizePathSegment(AGORIC_INSTANCE_NAME);
|
|
114
|
+
|
|
115
|
+
const feedsStorage = await makeStorageNodeChild(chainStorage, STORAGE_PATH);
|
|
116
|
+
const storageNode = await E(feedsStorage).makeChildNode(label);
|
|
117
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
118
|
+
|
|
119
|
+
const terms = harden({
|
|
120
|
+
...contractTerms,
|
|
121
|
+
description: AGORIC_INSTANCE_NAME,
|
|
122
|
+
brandIn,
|
|
123
|
+
brandOut,
|
|
124
|
+
// XXX powerful TimerService, see #6003
|
|
125
|
+
timer: await chainTimerService,
|
|
126
|
+
unitAmountIn: await unitAmount(brandIn),
|
|
127
|
+
});
|
|
128
|
+
const privateArgs = {
|
|
129
|
+
highPrioritySendersManager: await highPrioritySendersManager,
|
|
130
|
+
marshaller,
|
|
131
|
+
namesByAddressAdmin,
|
|
132
|
+
storageNode,
|
|
133
|
+
};
|
|
134
|
+
const governedKit = await E(startGovernedUpgradable)({
|
|
135
|
+
governedParams: {},
|
|
136
|
+
privateArgs,
|
|
137
|
+
terms,
|
|
138
|
+
label,
|
|
139
|
+
// @ts-expect-error GovernableStartFn vs. fluxAggregatorContract.js start
|
|
140
|
+
installation,
|
|
141
|
+
});
|
|
142
|
+
produceInstance[AGORIC_INSTANCE_NAME].reset();
|
|
143
|
+
produceInstance[AGORIC_INSTANCE_NAME].resolve(governedKit.instance);
|
|
144
|
+
trace(
|
|
145
|
+
'new instance',
|
|
146
|
+
label,
|
|
147
|
+
{ terms, privateArgs, installation },
|
|
148
|
+
governedKit,
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
await E(E.get(econCharterKit).creatorFacet).addInstance(
|
|
152
|
+
governedKit.instance,
|
|
153
|
+
governedKit.governorCreatorFacet,
|
|
154
|
+
AGORIC_INSTANCE_NAME,
|
|
155
|
+
);
|
|
156
|
+
trace('added', label, 'instance to econCharter');
|
|
157
|
+
|
|
158
|
+
/** @type {import('@agoric/zoe/src/zoeService/utils.js').StartedInstanceKit<FluxStartFn>} */
|
|
159
|
+
// @ts-expect-error
|
|
160
|
+
const { instance, publicFacet, creatorFacet } = governedKit;
|
|
161
|
+
|
|
162
|
+
return harden({ instance, publicFacet, creatorFacet });
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Send invitations to oracle operators for a price feed.
|
|
167
|
+
*
|
|
168
|
+
* @param {EconomyBootstrapPowers} powers
|
|
169
|
+
* @param {{ oracleAddresses: string[]; AGORIC_INSTANCE_NAME: string }} config
|
|
170
|
+
* @param {any} creatorFacet
|
|
171
|
+
*/
|
|
172
|
+
const distributeInvitations = async (
|
|
173
|
+
{ consume: { namesByAddressAdmin } },
|
|
174
|
+
{ oracleAddresses, AGORIC_INSTANCE_NAME },
|
|
175
|
+
creatorFacet,
|
|
176
|
+
) => {
|
|
177
|
+
/** @param {string} addr */
|
|
178
|
+
const addOracle = async addr => {
|
|
179
|
+
const invitation = await E(creatorFacet).makeOracleInvitation(addr);
|
|
180
|
+
const debugName = `${AGORIC_INSTANCE_NAME} member ${addr}`;
|
|
181
|
+
await reserveThenDeposit(debugName, namesByAddressAdmin, addr, [
|
|
182
|
+
invitation,
|
|
183
|
+
]).catch(err => console.error(`failed deposit to ${debugName}`, err));
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
trace('distributing invitations', oracleAddresses);
|
|
187
|
+
// This doesn't resolve until oracle operators create their smart wallets.
|
|
188
|
+
// Don't block completion on it.
|
|
189
|
+
void Promise.all(oracleAddresses.map(addOracle));
|
|
190
|
+
trace('createPriceFeed complete');
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @param {EconomyBootstrapPowers & NamedVatPowers} powers
|
|
195
|
+
* @param {{
|
|
196
|
+
* options: PriceFeedConfig & {
|
|
197
|
+
* priceAggregatorRef: { bundleID: string };
|
|
198
|
+
* scaledPARef: { bundleID: string };
|
|
199
|
+
* inBrandsDecimals?: number;
|
|
200
|
+
* contractTerms?: ChainlinkConfig;
|
|
201
|
+
* outBrandName?: string;
|
|
202
|
+
* outBrandDecimals?: number;
|
|
203
|
+
* };
|
|
204
|
+
* }} config
|
|
205
|
+
*/
|
|
206
|
+
export const deployPriceFeeds = async (powers, config) => {
|
|
207
|
+
const {
|
|
208
|
+
inBrandNames,
|
|
209
|
+
oracleAddresses,
|
|
210
|
+
contractTerms,
|
|
211
|
+
priceAggregatorRef,
|
|
212
|
+
scaledPARef,
|
|
213
|
+
inBrandsDecimals = 6,
|
|
214
|
+
outBrandName = 'USD',
|
|
215
|
+
outBrandDecimals = 6,
|
|
216
|
+
} = config.options;
|
|
217
|
+
await null;
|
|
218
|
+
|
|
219
|
+
const installation = await installPriceAggregator(
|
|
220
|
+
powers,
|
|
221
|
+
priceAggregatorRef.bundleID,
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
const { priceAuthorityAdmin, priceAuthority } = powers.consume;
|
|
225
|
+
for (const inBrandName of inBrandNames) {
|
|
226
|
+
const AGORIC_INSTANCE_NAME = oracleBrandFeedName(inBrandName, outBrandName);
|
|
227
|
+
const brandIn = await ensureOracleBrand(powers, {
|
|
228
|
+
name: inBrandName,
|
|
229
|
+
decimalPlaces: inBrandsDecimals,
|
|
230
|
+
});
|
|
231
|
+
const brandOut = await ensureOracleBrand(powers, {
|
|
232
|
+
name: outBrandName,
|
|
233
|
+
decimalPlaces: outBrandDecimals,
|
|
234
|
+
});
|
|
235
|
+
const kit = await startPriceAggregatorInstance(
|
|
236
|
+
powers,
|
|
237
|
+
{
|
|
238
|
+
AGORIC_INSTANCE_NAME,
|
|
239
|
+
brandIn,
|
|
240
|
+
brandOut,
|
|
241
|
+
contractTerms: { ...DEFAULT_CONTRACT_TERMS, ...contractTerms },
|
|
242
|
+
},
|
|
243
|
+
installation,
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
const forceReplace = true;
|
|
247
|
+
await E(priceAuthorityAdmin).registerPriceAuthority(
|
|
248
|
+
E(kit.publicFacet).getPriceAuthority(),
|
|
249
|
+
brandIn,
|
|
250
|
+
brandOut,
|
|
251
|
+
forceReplace,
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
await distributeInvitations(
|
|
255
|
+
powers,
|
|
256
|
+
{ oracleAddresses, AGORIC_INSTANCE_NAME },
|
|
257
|
+
kit.creatorFacet,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// @ts-expect-error replaceScaledPriceAuthorities uses a subset of the powers.
|
|
262
|
+
await replaceScaledPriceAuthorities(powers, {
|
|
263
|
+
options: { scaledPARef },
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
// cf. #8400 QuotePayments storage leak
|
|
267
|
+
powers.produce.priceAuthority8400.resolve(priceAuthority);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const t = 'priceFeed';
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Thread price feed upgrade options through from builder to core-eval.
|
|
274
|
+
*
|
|
275
|
+
* @param {object} utils
|
|
276
|
+
* @param {any} utils.restoreRef
|
|
277
|
+
* @param {PriceFeedConfig & { priceAggregatorRef: any }} priceFeedOptions
|
|
278
|
+
*/
|
|
279
|
+
export const getManifestForPriceFeeds = async (
|
|
280
|
+
{ restoreRef: _restoreRef },
|
|
281
|
+
priceFeedOptions,
|
|
282
|
+
) => ({
|
|
283
|
+
manifest: {
|
|
284
|
+
[deployPriceFeeds.name]: {
|
|
285
|
+
namedVat: t,
|
|
286
|
+
consume: {
|
|
287
|
+
agoricNamesAdmin: t,
|
|
288
|
+
agoricNames: t,
|
|
289
|
+
board: t,
|
|
290
|
+
chainStorage: t,
|
|
291
|
+
chainTimerService: t,
|
|
292
|
+
contractKits: t,
|
|
293
|
+
econCharterKit: t,
|
|
294
|
+
highPrioritySendersManager: t,
|
|
295
|
+
instancePrivateArgs: t,
|
|
296
|
+
namesByAddressAdmin: t,
|
|
297
|
+
priceAuthority: t,
|
|
298
|
+
priceAuthorityAdmin: t,
|
|
299
|
+
startGovernedUpgradable: t,
|
|
300
|
+
startUpgradable: t,
|
|
301
|
+
zoe: t,
|
|
302
|
+
},
|
|
303
|
+
installation: { produce: { priceAggregator: t } },
|
|
304
|
+
instance: {
|
|
305
|
+
produce: t,
|
|
306
|
+
},
|
|
307
|
+
oracleBrand: { produce: t },
|
|
308
|
+
produce: { priceAuthority8400: t },
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
options: { ...priceFeedOptions },
|
|
312
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price-feed-proposal.d.ts","sourceRoot":"","sources":["price-feed-proposal.js"],"names":[],"mappings":";AA6CO,+HAJI,mBAAmB,GAAG,cAAc,8JACpC;IAAE,OAAO,EAAE;QAAE,gBAAgB,EAAE,gBAAgB,CAAA;KAAE,CAAA;CAAE,GACjD,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAsCjD;AAiBM,iSAdI,mBAAmB,qJACnB;IACN,OAAO,EAAE;QACP,gBAAgB,EAAE;YAChB,oBAAoB,EAAE,MAAM,CAAC;YAC7B,eAAe,EAAE,MAAM,EAAE,CAAC;YAC1B,aAAa,EAAE,OAAO,uDAAuD,EAAE,eAAe,CAAC;YAC/F,aAAa,EAAE,MAAM,CAAC;YACtB,cAAc,EAAE,MAAM,CAAC;YACvB,kBAAkB,EAAE,YAAY,CAAC;SAClC,CAAC;KACH,CAAC;CACH,
|
|
1
|
+
{"version":3,"file":"price-feed-proposal.d.ts","sourceRoot":"","sources":["price-feed-proposal.js"],"names":[],"mappings":";AA6CO,+HAJI,mBAAmB,GAAG,cAAc,8JACpC;IAAE,OAAO,EAAE;QAAE,gBAAgB,EAAE,gBAAgB,CAAA;KAAE,CAAA;CAAE,GACjD,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAsCjD;AAiBM,iSAdI,mBAAmB,qJACnB;IACN,OAAO,EAAE;QACP,gBAAgB,EAAE;YAChB,oBAAoB,EAAE,MAAM,CAAC;YAC7B,eAAe,EAAE,MAAM,EAAE,CAAC;YAC1B,aAAa,EAAE,OAAO,uDAAuD,EAAE,eAAe,CAAC;YAC/F,aAAa,EAAE,MAAM,CAAC;YACtB,cAAc,EAAE,MAAM,CAAC;YACvB,kBAAkB,EAAE,YAAY,CAAC;SAClC,CAAC;KACH,CAAC;CACH,iBAiKH;AAWM,wDAHJ;IAAmD,UAAU,UAA/C,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC;CAC1C,oBAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA3OP,MAAM;+BACF,MAAM;4BACT,MAAM;gCACF,MAAM;;;GAyR7B;AAQK,wGALI,OAAO,qBAAqB,EAAE,sBAAsB;;;;8BA8D9D;+BAhWY;IACR,OAAO,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;oCAtBG,YAAY"}
|
|
@@ -227,7 +227,8 @@ export const createPriceFeed = async (
|
|
|
227
227
|
|
|
228
228
|
// being after the above awaits means that when this resolves, the consumer
|
|
229
229
|
// gets notified that the authority is in the registry and its instance is in
|
|
230
|
-
// agoricNames.
|
|
230
|
+
// agoricNames. reset() in case we're replacing an existing feed.
|
|
231
|
+
produceInstance[AGORIC_INSTANCE_NAME].reset();
|
|
231
232
|
produceInstance[AGORIC_INSTANCE_NAME].resolve(faKit.instance);
|
|
232
233
|
|
|
233
234
|
E(E.get(econCharterKit).creatorFacet).addInstance(
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function replaceScaledPriceAuthority(powers: BootstrapPowers, { options }: {
|
|
2
|
+
options: object;
|
|
3
|
+
}): Promise<void>;
|
|
4
|
+
export function replaceScaledPriceAuthorities(powers: ChainBootstrapSpace & BootstrapPowers, { options }: {
|
|
5
|
+
options: {
|
|
6
|
+
scaledPARef: {
|
|
7
|
+
bundleID: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export function getManifestForReplaceScaledPriceAuthorities(_ign: any, upgradeSPAOptions: any): Promise<{
|
|
12
|
+
manifest: {
|
|
13
|
+
[x: string]: {
|
|
14
|
+
consume: {
|
|
15
|
+
agoricNames: string;
|
|
16
|
+
priceAuthority: string;
|
|
17
|
+
startUpgradable: string;
|
|
18
|
+
zoe: string;
|
|
19
|
+
agoricNamesAdmin: string;
|
|
20
|
+
contractKits: string;
|
|
21
|
+
priceAuthorityAdmin: string;
|
|
22
|
+
};
|
|
23
|
+
instance: {
|
|
24
|
+
produce: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
options: any;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=replace-scaledPriceAuthorities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-scaledPriceAuthorities.d.ts","sourceRoot":"","sources":["replace-scaledPriceAuthorities.js"],"names":[],"mappings":"AAaO,oDAJI,eAAe,eAEvB;IAAuB,OAAO,EAAtB,MAAM;CAChB,iBAeA;AAUM,sDAHI,mBAAmB,GAAG,eAAe,eACrC;IAAE,OAAO,EAAE;QAAE,WAAW,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,iBA2D5D;AAGM;;;;;;;;;;;;;;;;;;GA0BL"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { makeTracer } from '@agoric/internal';
|
|
2
|
+
import { E } from '@endo/far';
|
|
3
|
+
|
|
4
|
+
import { startScaledPriceAuthority } from './addAssetToVault.js';
|
|
5
|
+
import { scaledPriceFeedName } from './utils.js';
|
|
6
|
+
|
|
7
|
+
const trace = makeTracer('replaceScaledPA', true);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {BootstrapPowers} powers
|
|
11
|
+
* @param {object} config
|
|
12
|
+
* @param {object} config.options
|
|
13
|
+
*/
|
|
14
|
+
export const replaceScaledPriceAuthority = async (powers, { options }) => {
|
|
15
|
+
const {
|
|
16
|
+
instance: { produce: produceInstance },
|
|
17
|
+
} = powers;
|
|
18
|
+
const { issuerName } = options.interchainAssetOptions;
|
|
19
|
+
|
|
20
|
+
const spaKit = await startScaledPriceAuthority(powers, { options });
|
|
21
|
+
|
|
22
|
+
const label = scaledPriceFeedName(issuerName);
|
|
23
|
+
produceInstance[label].reset();
|
|
24
|
+
|
|
25
|
+
// publish into agoricNames. This must stay after registerPriceAuthority,
|
|
26
|
+
// which is called by startScaledPriceAuthority()
|
|
27
|
+
produceInstance[label].resolve(spaKit.instance);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Look up the existing assets known to auctions, and replace the corresponding
|
|
32
|
+
* scaledPriceAuthorities. The existing contracts will be left behind to be
|
|
33
|
+
* cleaned up later.
|
|
34
|
+
*
|
|
35
|
+
* @param {ChainBootstrapSpace & BootstrapPowers} powers
|
|
36
|
+
* @param {{ options: { scaledPARef: { bundleID: string } } }} options
|
|
37
|
+
*/
|
|
38
|
+
export const replaceScaledPriceAuthorities = async (powers, { options }) => {
|
|
39
|
+
trace('start');
|
|
40
|
+
const {
|
|
41
|
+
consume: {
|
|
42
|
+
agoricNamesAdmin,
|
|
43
|
+
agoricNames,
|
|
44
|
+
contractKits: contractKitsP,
|
|
45
|
+
zoe,
|
|
46
|
+
},
|
|
47
|
+
} = powers;
|
|
48
|
+
|
|
49
|
+
const { scaledPARef } = options;
|
|
50
|
+
|
|
51
|
+
const installationsAdmin = E(agoricNamesAdmin).lookupAdmin('installation');
|
|
52
|
+
const [spaInstallation, contractKits] = await Promise.all([
|
|
53
|
+
E(E(installationsAdmin).readonly()).lookup('scaledPriceAuthority'),
|
|
54
|
+
contractKitsP,
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
const bundleID = scaledPARef.bundleID;
|
|
58
|
+
if (scaledPARef && bundleID) {
|
|
59
|
+
await E.when(
|
|
60
|
+
E(zoe).installBundleID(bundleID),
|
|
61
|
+
installation =>
|
|
62
|
+
E(installationsAdmin).update('scaledPriceAuthority', installation),
|
|
63
|
+
err =>
|
|
64
|
+
console.error(
|
|
65
|
+
`🚨 failed to update scaledPriceAuthority installation`,
|
|
66
|
+
err,
|
|
67
|
+
),
|
|
68
|
+
);
|
|
69
|
+
trace('installed scaledPriceAuthority bundle', bundleID);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Ask Zoe for the installation for each kit's instance, and return all the
|
|
73
|
+
// kits where that matches the given installation.
|
|
74
|
+
async function maybeSPAKit(kit) {
|
|
75
|
+
const installation = await E(zoe).getInstallationForInstance(kit.instance);
|
|
76
|
+
return spaInstallation === installation ? [kit] : [];
|
|
77
|
+
}
|
|
78
|
+
const scaledPAKits = (
|
|
79
|
+
await Promise.all([...contractKits.values()].map(maybeSPAKit))
|
|
80
|
+
).flat();
|
|
81
|
+
|
|
82
|
+
const namedBrands = await E(E(agoricNames).lookup('brand')).entries();
|
|
83
|
+
|
|
84
|
+
for (const kitEntry of scaledPAKits) {
|
|
85
|
+
const { instance } = kitEntry;
|
|
86
|
+
const terms = await E(powers.consume.zoe).getTerms(instance);
|
|
87
|
+
const { brand } = terms.scaleIn.denominator;
|
|
88
|
+
const entry = namedBrands.find(([_k, v]) => v === brand);
|
|
89
|
+
assert(entry, 'unable to find issuerName for ', brand);
|
|
90
|
+
const issuerName = entry[0];
|
|
91
|
+
await replaceScaledPriceAuthority(powers, {
|
|
92
|
+
options: { interchainAssetOptions: { issuerName } },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const t = 'replaceScaledPriceAuthority';
|
|
98
|
+
export const getManifestForReplaceScaledPriceAuthorities = async (
|
|
99
|
+
_ign,
|
|
100
|
+
upgradeSPAOptions,
|
|
101
|
+
) => ({
|
|
102
|
+
manifest: {
|
|
103
|
+
[replaceScaledPriceAuthorities.name]: {
|
|
104
|
+
consume: {
|
|
105
|
+
// //// Widely known ////
|
|
106
|
+
agoricNames: t,
|
|
107
|
+
priceAuthority: t,
|
|
108
|
+
startUpgradable: t,
|
|
109
|
+
zoe: t,
|
|
110
|
+
|
|
111
|
+
// //// closely held, powerful ////
|
|
112
|
+
agoricNamesAdmin: t,
|
|
113
|
+
contractKits: t,
|
|
114
|
+
priceAuthorityAdmin: t,
|
|
115
|
+
},
|
|
116
|
+
instance: {
|
|
117
|
+
// This is a right to add/replace any instance. That we update only the
|
|
118
|
+
// relevant ones must be verified by inspection.
|
|
119
|
+
produce: t,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
options: { ...upgradeSPAOptions },
|
|
124
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function upgradeVaults({ consume: { auctionUpgradeNewInstance, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, reserveKit, vaultFactoryKit, zoe, }, produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer }, installation: { produce: { VaultFactory: produceVaultInstallation }, }, instance: { consume: { auctioneer: auctioneerInstanceP }, }, }: import("../../src/proposals/econ-behaviors").EconomyBootstrapPowers & interlockPowers, { options }: {
|
|
1
|
+
export function upgradeVaults({ consume: { auctionUpgradeNewInstance, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, reserveKit, vaultFactoryKit, zoe, priceAuthority8400, }, produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer }, installation: { produce: { VaultFactory: produceVaultInstallation }, }, instance: { consume: { auctioneer: auctioneerInstanceP }, }, }: import("../../src/proposals/econ-behaviors").EconomyBootstrapPowers & interlockPowers, { options }: {
|
|
2
2
|
options: {
|
|
3
3
|
vaultsRef: {
|
|
4
4
|
bundleID: string;
|
|
@@ -9,6 +9,7 @@ export function getManifestForUpgradeVaults(_ign: object, vaultUpgradeOptions: a
|
|
|
9
9
|
manifest: {
|
|
10
10
|
[x: string]: {
|
|
11
11
|
consume: {
|
|
12
|
+
priceAuthority8400: string;
|
|
12
13
|
auctionUpgradeNewInstance: string;
|
|
13
14
|
chainTimerService: string;
|
|
14
15
|
economicCommitteeCreatorFacet: string;
|
|
@@ -34,6 +35,7 @@ export function getManifestForUpgradeVaults(_ign: object, vaultUpgradeOptions: a
|
|
|
34
35
|
options: any;
|
|
35
36
|
}>;
|
|
36
37
|
export type interlockPowers = PromiseSpaceOf<{
|
|
38
|
+
priceAuthority8400: Instance;
|
|
37
39
|
auctionUpgradeNewInstance: Instance;
|
|
38
40
|
}>;
|
|
39
41
|
//# sourceMappingURL=upgrade-vaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-vaults.d.ts","sourceRoot":"","sources":["upgrade-vaults.js"],"names":[],"mappings":"AAoBO,
|
|
1
|
+
{"version":3,"file":"upgrade-vaults.d.ts","sourceRoot":"","sources":["upgrade-vaults.js"],"names":[],"mappings":"AAoBO,4ZAJI,OAAO,oCAAoC,EAAE,sBAAsB,GACvE,eAAe,eACX;IAAE,OAAO,EAAE;QAAE,SAAS,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,iBA2J1D;AASM,kDAHI,MAAM,uBACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyBZ;8BApMW,cAAc,CAAC;IACvB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,yBAAyB,EAAE,QAAQ,CAAC;CACrC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { E } from '@endo/far';
|
|
2
2
|
import { makeNotifierFromAsyncIterable } from '@agoric/notifier';
|
|
3
|
-
import { AmountMath } from '@agoric/ertp/src/index.js';
|
|
4
3
|
import { makeTracer } from '@agoric/internal/src/index.js';
|
|
5
4
|
import { Fail } from '@endo/errors';
|
|
6
5
|
import { TimeMath } from '@agoric/time';
|
|
@@ -9,6 +8,7 @@ const trace = makeTracer('upgrade Vaults proposal');
|
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @typedef {PromiseSpaceOf<{
|
|
11
|
+
* priceAuthority8400: Instance;
|
|
12
12
|
* auctionUpgradeNewInstance: Instance;
|
|
13
13
|
* }>} interlockPowers
|
|
14
14
|
*/
|
|
@@ -27,6 +27,7 @@ export const upgradeVaults = async (
|
|
|
27
27
|
reserveKit,
|
|
28
28
|
vaultFactoryKit,
|
|
29
29
|
zoe,
|
|
30
|
+
priceAuthority8400,
|
|
30
31
|
},
|
|
31
32
|
produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer },
|
|
32
33
|
installation: {
|
|
@@ -44,6 +45,8 @@ export const upgradeVaults = async (
|
|
|
44
45
|
const allBrands = await E(zoe).getBrands(directorInstance);
|
|
45
46
|
const { Minted: _istBrand, ...vaultBrands } = allBrands;
|
|
46
47
|
|
|
48
|
+
await priceAuthority8400;
|
|
49
|
+
|
|
47
50
|
const bundleID = vaultsRef.bundleID;
|
|
48
51
|
console.log(`upgradeVaults: bundleId`, bundleID);
|
|
49
52
|
/**
|
|
@@ -77,24 +80,21 @@ export const upgradeVaults = async (
|
|
|
77
80
|
|
|
78
81
|
const subscription = E(directorPF).getElectorateSubscription();
|
|
79
82
|
const notifier = makeNotifierFromAsyncIterable(subscription);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
`minInitialDebt was empty, retried`,
|
|
86
|
-
value.current.MinInitialDebt.value,
|
|
87
|
-
);
|
|
88
|
-
}
|
|
83
|
+
const { updateCount } = await notifier.getUpdateSince();
|
|
84
|
+
|
|
85
|
+
// subscribeAfter(<some known state>) retrieves the latest value.
|
|
86
|
+
const after = await E(subscription).subscribeAfter(updateCount);
|
|
87
|
+
const { current } = after.head.value;
|
|
89
88
|
|
|
90
89
|
return harden({
|
|
91
|
-
MinInitialDebt:
|
|
92
|
-
ReferencedUI:
|
|
93
|
-
RecordingPeriod:
|
|
94
|
-
ChargingPeriod:
|
|
90
|
+
MinInitialDebt: current.MinInitialDebt.value,
|
|
91
|
+
ReferencedUI: current.ReferencedUI.value,
|
|
92
|
+
RecordingPeriod: current.RecordingPeriod.value,
|
|
93
|
+
ChargingPeriod: current.ChargingPeriod.value,
|
|
95
94
|
});
|
|
96
95
|
};
|
|
97
96
|
const directorParamOverrides = await readCurrentDirectorParams();
|
|
97
|
+
trace({ directorParamOverrides });
|
|
98
98
|
|
|
99
99
|
const readManagerParams = async () => {
|
|
100
100
|
const { publicFacet: directorPF } = kit;
|
|
@@ -104,34 +104,22 @@ export const upgradeVaults = async (
|
|
|
104
104
|
const params = {};
|
|
105
105
|
for (const kwd of Object.keys(vaultBrands)) {
|
|
106
106
|
const collateralBrand = vaultBrands[kwd];
|
|
107
|
-
|
|
107
|
+
|
|
108
|
+
/** @type {any} */
|
|
109
|
+
const governedParams = await E(directorPF).getGovernedParams({
|
|
108
110
|
collateralBrand,
|
|
109
111
|
});
|
|
110
|
-
|
|
111
|
-
let { value, updateCount } = await notifier.getUpdateSince(0n);
|
|
112
|
-
// @ts-expect-error It's an amount.
|
|
113
|
-
if (AmountMath.isEmpty(value.current.DebtLimit.value)) {
|
|
114
|
-
// The parameters might have been empty at start, and the notifier might
|
|
115
|
-
// give the first state before the current state.
|
|
116
|
-
trace(`debtLimit was empty, retrying`, value.current.DebtLimit.value);
|
|
117
|
-
({ value, updateCount } = await notifier.getUpdateSince(updateCount));
|
|
118
|
-
|
|
119
|
-
// @ts-expect-error It's an amount.
|
|
120
|
-
if (AmountMath.isEmpty(value.current.DebtLimit.value)) {
|
|
121
|
-
trace('debtLimit was empty after retrying');
|
|
122
|
-
throw Error('🚨Governed parameters empty after retry, Giving up');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
trace(kwd, 'params at', updateCount, 'are', value.current);
|
|
112
|
+
trace({ kwd, governedParams });
|
|
126
113
|
params[kwd] = harden({
|
|
127
114
|
brand: collateralBrand,
|
|
128
|
-
debtLimit:
|
|
129
|
-
interestRate:
|
|
130
|
-
liquidationMargin:
|
|
131
|
-
liquidationPadding:
|
|
132
|
-
liquidationPenalty:
|
|
133
|
-
mintFee:
|
|
115
|
+
debtLimit: governedParams.DebtLimit.value,
|
|
116
|
+
interestRate: governedParams.InterestRate.value,
|
|
117
|
+
liquidationMargin: governedParams.LiquidationMargin.value,
|
|
118
|
+
liquidationPadding: governedParams.LiquidationPadding.value,
|
|
119
|
+
liquidationPenalty: governedParams.LiquidationPenalty.value,
|
|
120
|
+
mintFee: governedParams.MintFee.value,
|
|
134
121
|
});
|
|
122
|
+
trace(kwd, params[kwd]);
|
|
135
123
|
}
|
|
136
124
|
return params;
|
|
137
125
|
};
|
|
@@ -167,12 +155,11 @@ export const upgradeVaults = async (
|
|
|
167
155
|
|
|
168
156
|
trace('upgraded vaultFactory.', upgradeResult);
|
|
169
157
|
};
|
|
170
|
-
|
|
171
158
|
await upgradeVaultFactory();
|
|
172
159
|
|
|
173
160
|
// @ts-expect-error It's saved in econ-behaviors.js:startVaultFactory()
|
|
174
161
|
const vaultFactoryPrivateArgs = kit.privateArgs;
|
|
175
|
-
|
|
162
|
+
trace('restarting governor');
|
|
176
163
|
|
|
177
164
|
const ecf = await electorateCreatorFacet;
|
|
178
165
|
// restart vaultFactory governor
|
|
@@ -183,7 +170,7 @@ export const upgradeVaults = async (
|
|
|
183
170
|
}),
|
|
184
171
|
);
|
|
185
172
|
|
|
186
|
-
|
|
173
|
+
trace('restarted governor');
|
|
187
174
|
};
|
|
188
175
|
|
|
189
176
|
const uV = 'upgradeVaults';
|
|
@@ -200,6 +187,7 @@ export const getManifestForUpgradeVaults = async (
|
|
|
200
187
|
manifest: {
|
|
201
188
|
[upgradeVaults.name]: {
|
|
202
189
|
consume: {
|
|
190
|
+
priceAuthority8400: uV,
|
|
203
191
|
auctionUpgradeNewInstance: uV,
|
|
204
192
|
chainTimerService: uV,
|
|
205
193
|
economicCommitteeCreatorFacet: uV,
|
package/src/proposals/utils.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ export function makeInstallCache(homeP: {
|
|
|
14
14
|
}>;
|
|
15
15
|
export function oracleBrandFeedName(inBrandName: any, outBrandName: any): string;
|
|
16
16
|
export function scaledPriceFeedName(issuerName: any): string;
|
|
17
|
+
/** @type {(name: string) => string} */
|
|
18
|
+
export const sanitizePathSegment: (name: string) => string;
|
|
17
19
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAYO,mDAHI,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,SACtC,MAAM,EAAE,EAAE,kBA+BpB;AAMM,+CAHI,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,SACtC,MAAM,EAAE,kBAMhB;AAQI,8CALI,MAAM,uBACN,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,QACtC,MAAM,YACN,IAAI,CAAC,OAAO,CAAC,EAAE,iBAuBzB;AA6BM,wCAPI;IACN,OAAO,EAAE,IAAI,CAAC,OAAO,iCAAiC,EAAE,UAAU,CAAC,CAAC;CACrE,mCAED;IAAkE,UAAU,EAApE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,eAAe;CAAC;;;GAoDxC;AAEM,iFACsC;AAEtC,6DAC+B;AAEtC,uCAAuC;AACvC,kCADW,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAKjC"}
|
package/src/proposals/utils.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Fail } from '@endo/errors';
|
|
|
2
2
|
import { E } from '@endo/far';
|
|
3
3
|
import { WalletName } from '@agoric/internal';
|
|
4
4
|
import { getCopyMapEntries, makeCopyMap } from '@agoric/store';
|
|
5
|
+
import { assertPathSegment } from '@agoric/internal/src/lib-chainStorage.js';
|
|
5
6
|
|
|
6
7
|
/** @import {CopyMap} from '@endo/patterns'; */
|
|
7
8
|
|
|
@@ -163,3 +164,10 @@ export const oracleBrandFeedName = (inBrandName, outBrandName) =>
|
|
|
163
164
|
|
|
164
165
|
export const scaledPriceFeedName = issuerName =>
|
|
165
166
|
`scaledPriceAuthority-${issuerName}`;
|
|
167
|
+
|
|
168
|
+
/** @type {(name: string) => string} */
|
|
169
|
+
export const sanitizePathSegment = name => {
|
|
170
|
+
const candidate = name.replace(/ /g, '_');
|
|
171
|
+
assertPathSegment(candidate);
|
|
172
|
+
return candidate;
|
|
173
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaultManager.d.ts","sourceRoot":"","sources":["vaultManager.js"],"names":[],"mappings":"AAqFO,mCANM,CAAC,EACQ,CAAC,SAAT,GAAG,EAAG,yBACT,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WACpB,OAAO,4BAA4B,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,WACzD,CAAC,iBAqBX;AAwHM,gDATI,OAAO,4BAA4B,EAAE,OAAO,uDAC5C;IACN,GAAG,EAAE,OAAO,mBAAmB,EAAE,eAAe,CAAC;IACjD,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,eAAe,EAAE,OAAO,6CAA6C,EAAE,e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VaultManagerKit = (
|
|
|
455
455
|
// will throw. See https://github.com/Agoric/agoric-sdk/issues/4317
|
|
456
456
|
const quoteWatcher = harden({
|
|
457
457
|
onFulfilled(value) {
|
|
458
|
+
trace('watcher updated price', value);
|
|
458
459
|
ephemera.storedCollateralQuote = value;
|
|
459
460
|
},
|
|
460
461
|
onRejected() {
|