@agoric/inter-protocol 0.16.2-dev-2ac22d3.0 → 0.16.2-dev-a0c5f45.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/inter-protocol",
3
- "version": "0.16.2-dev-2ac22d3.0+2ac22d3",
3
+ "version": "0.16.2-dev-a0c5f45.0+a0c5f45",
4
4
  "description": "Core cryptoeconomy contracts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -31,16 +31,16 @@
31
31
  },
32
32
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
33
33
  "dependencies": {
34
- "@agoric/assert": "0.6.1-dev-2ac22d3.0+2ac22d3",
35
- "@agoric/ertp": "0.16.3-dev-2ac22d3.0+2ac22d3",
36
- "@agoric/governance": "0.10.4-dev-2ac22d3.0+2ac22d3",
37
- "@agoric/internal": "0.3.3-dev-2ac22d3.0+2ac22d3",
38
- "@agoric/notifier": "0.6.3-dev-2ac22d3.0+2ac22d3",
39
- "@agoric/store": "0.9.3-dev-2ac22d3.0+2ac22d3",
40
- "@agoric/time": "0.3.3-dev-2ac22d3.0+2ac22d3",
41
- "@agoric/vat-data": "0.5.3-dev-2ac22d3.0+2ac22d3",
42
- "@agoric/vats": "0.15.2-dev-2ac22d3.0+2ac22d3",
43
- "@agoric/zoe": "0.26.3-dev-2ac22d3.0+2ac22d3",
34
+ "@agoric/assert": "0.6.1-dev-a0c5f45.0+a0c5f45",
35
+ "@agoric/ertp": "0.16.3-dev-a0c5f45.0+a0c5f45",
36
+ "@agoric/governance": "0.10.4-dev-a0c5f45.0+a0c5f45",
37
+ "@agoric/internal": "0.3.3-dev-a0c5f45.0+a0c5f45",
38
+ "@agoric/notifier": "0.6.3-dev-a0c5f45.0+a0c5f45",
39
+ "@agoric/store": "0.9.3-dev-a0c5f45.0+a0c5f45",
40
+ "@agoric/time": "0.3.3-dev-a0c5f45.0+a0c5f45",
41
+ "@agoric/vat-data": "0.5.3-dev-a0c5f45.0+a0c5f45",
42
+ "@agoric/vats": "0.15.2-dev-a0c5f45.0+a0c5f45",
43
+ "@agoric/zoe": "0.26.3-dev-a0c5f45.0+a0c5f45",
44
44
  "@endo/captp": "^3.1.4",
45
45
  "@endo/eventual-send": "^0.17.5",
46
46
  "@endo/far": "^0.2.21",
@@ -49,10 +49,10 @@
49
49
  "jessie.js": "^0.3.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@agoric/smart-wallet": "0.5.4-dev-2ac22d3.0+2ac22d3",
53
- "@agoric/swingset-liveslots": "0.10.3-dev-2ac22d3.0+2ac22d3",
54
- "@agoric/swingset-vat": "0.32.3-dev-2ac22d3.0+2ac22d3",
55
- "@agoric/zone": "0.2.3-dev-2ac22d3.0+2ac22d3",
52
+ "@agoric/smart-wallet": "0.5.4-dev-a0c5f45.0+a0c5f45",
53
+ "@agoric/swingset-liveslots": "0.10.3-dev-a0c5f45.0+a0c5f45",
54
+ "@agoric/swingset-vat": "0.32.3-dev-a0c5f45.0+a0c5f45",
55
+ "@agoric/zone": "0.2.3-dev-a0c5f45.0+a0c5f45",
56
56
  "@endo/bundle-source": "^2.7.0",
57
57
  "@endo/init": "^0.5.59",
58
58
  "@endo/promise-kit": "^0.2.59",
@@ -84,5 +84,5 @@
84
84
  "typeCoverage": {
85
85
  "atLeast": 93.45
86
86
  },
87
- "gitHead": "2ac22d3353281e7319adca67a8580024171a8066"
87
+ "gitHead": "a0c5f45598785cdb60fb472649eecdcd13f05108"
88
88
  }
@@ -133,9 +133,23 @@ export type InterchainAssetOptions = {
133
133
  issuerBoardId?: string | undefined;
134
134
  denom?: string | undefined;
135
135
  decimalPlaces?: number | undefined;
136
- proposedName?: string | undefined;
136
+ /**
137
+ * - used in regstering with reserve, vaultFactory
138
+ */
137
139
  keyword: string;
138
- oracleBrand: string;
140
+ /**
141
+ * - used in agoricNames for compatibility:
142
+ * defaults to `keyword` if not provided
143
+ */
144
+ issuerName?: string | undefined;
145
+ /**
146
+ * - defaults to `issuerName` if not provided
147
+ */
148
+ proposedName?: string | undefined;
149
+ /**
150
+ * - defaults to `issuerName` if not provided
151
+ */
152
+ oracleBrand?: string | undefined;
139
153
  initialPrice?: number | undefined;
140
154
  };
141
155
  export type EconomyBootstrapPowers = import('./econ-behaviors.js').EconomyBootstrapPowers;
@@ -1 +1 @@
1
- {"version":3,"file":"addAssetToVault.d.ts","sourceRoot":"","sources":["addAssetToVault.js"],"names":[],"mappings":";AA8BO,4FALI,sBAAsB;IAEP,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;;0BAmBhC;AAQM,yKALI,sBAAsB;IAEP,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;;kBA+ChC;AAQM,wIALI,eAAe;IAEA,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;;kBAkGhC;AAYM,+LAPI,sBAAsB;IAEP,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;QACmB,cAAc,EAAvD,MAAM,GAAG,MAAM,GAAG,MAAM;QACD,iBAAiB,EAAxC,MAAM;;kBAkDhB;AAEM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6EN;;;;;;aApUa,MAAM;iBACN,MAAM;;;qCA0LN,OAAO,qBAAqB,EAAE,sBAAsB;uBAvM3C,gCAAgC"}
1
+ {"version":3,"file":"addAssetToVault.d.ts","sourceRoot":"","sources":["addAssetToVault.js"],"names":[],"mappings":";AAgCO,4FALI,sBAAsB;IAEP,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;;0BAuBhC;AAQM,yKALI,sBAAsB;IAEP,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;;kBAoDhC;AAQM,wIALI,eAAe;IAEA,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;;kBAmGhC;AAYM,+LAPI,sBAAsB;IAEP,OAAO;QACiB,sBAAsB,EAA7D,sBAAsB;QACmB,cAAc,EAAvD,MAAM,GAAG,MAAM,GAAG,MAAM;QACD,iBAAiB,EAAxC,MAAM;;kBAuDhB;AAEM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6EN;;;;;;;;aAtVa,MAAM;;;;;;;;;;;;;;;;qCAwMN,OAAO,qBAAqB,EAAE,sBAAsB;uBAnN3C,gCAAgC"}
@@ -16,9 +16,11 @@ export * from './startPSM.js';
16
16
  * @property {string} [issuerBoardId]
17
17
  * @property {string} [denom]
18
18
  * @property {number} [decimalPlaces]
19
- * @property {string} [proposedName]
20
- * @property {string} keyword
21
- * @property {string} oracleBrand
19
+ * @property {string} keyword - used in regstering with reserve, vaultFactory
20
+ * @property {string} [issuerName] - used in agoricNames for compatibility:
21
+ * defaults to `keyword` if not provided
22
+ * @property {string} [proposedName] - defaults to `issuerName` if not provided
23
+ * @property {string} [oracleBrand] - defaults to `issuerName` if not provided
22
24
  * @property {number} [initialPrice]
23
25
  */
24
26
 
@@ -32,18 +34,22 @@ export const publishInterchainAssetFromBoardId = async (
32
34
  { consume: { board, agoricNamesAdmin } },
33
35
  { options: { interchainAssetOptions } },
34
36
  ) => {
35
- const { issuerBoardId, keyword } = interchainAssetOptions;
37
+ const {
38
+ issuerBoardId,
39
+ keyword,
40
+ issuerName = keyword,
41
+ } = interchainAssetOptions;
36
42
  // Incompatible with denom.
37
43
  assert.equal(interchainAssetOptions.denom, undefined);
38
44
  assert.typeof(issuerBoardId, 'string');
39
- assert.typeof(keyword, 'string');
45
+ assert.typeof(issuerName, 'string');
40
46
 
41
47
  const issuer = await E(board).getValue(issuerBoardId);
42
48
  const brand = await E(issuer).getBrand();
43
49
 
44
50
  return Promise.all([
45
- E(E(agoricNamesAdmin).lookupAdmin('issuer')).update(keyword, issuer),
46
- E(E(agoricNamesAdmin).lookupAdmin('brand')).update(keyword, brand),
51
+ E(E(agoricNamesAdmin).lookupAdmin('issuer')).update(issuerName, issuer),
52
+ E(E(agoricNamesAdmin).lookupAdmin('brand')).update(issuerName, brand),
47
53
  ]);
48
54
  };
49
55
 
@@ -62,18 +68,23 @@ export const publishInterchainAssetFromBank = async (
62
68
  },
63
69
  { options: { interchainAssetOptions } },
64
70
  ) => {
65
- const { denom, decimalPlaces, proposedName, keyword } =
66
- interchainAssetOptions;
71
+ const {
72
+ denom,
73
+ decimalPlaces,
74
+ keyword,
75
+ issuerName = keyword,
76
+ proposedName = keyword,
77
+ } = interchainAssetOptions;
67
78
 
68
79
  // Incompatible with issuerBoardId.
69
80
  assert.equal(interchainAssetOptions.issuerBoardId, undefined);
70
81
  assert.typeof(denom, 'string');
71
- assert.typeof(keyword, 'string');
72
82
  assert.typeof(decimalPlaces, 'number');
83
+ assert.typeof(issuerName, 'string');
73
84
  assert.typeof(proposedName, 'string');
74
85
 
75
86
  const terms = {
76
- keyword,
87
+ keyword: issuerName, // "keyword" is a misnomer in mintHolder terms
77
88
  assetKind: AssetKind.NAT,
78
89
  displayInfo: {
79
90
  decimalPlaces,
@@ -83,7 +94,7 @@ export const publishInterchainAssetFromBank = async (
83
94
 
84
95
  const { creatorFacet: mint, publicFacet: issuer } = await E(startUpgradable)({
85
96
  installation: mintHolder,
86
- label: keyword,
97
+ label: issuerName,
87
98
  privateArgs: undefined,
88
99
  terms,
89
100
  });
@@ -94,9 +105,9 @@ export const publishInterchainAssetFromBank = async (
94
105
  await E(E.get(reserveKit).creatorFacet).addIssuer(issuer, keyword);
95
106
 
96
107
  await Promise.all([
97
- E(E(agoricNamesAdmin).lookupAdmin('issuer')).update(keyword, issuer),
98
- E(E(agoricNamesAdmin).lookupAdmin('brand')).update(keyword, brand),
99
- E(bankManager).addAsset(denom, keyword, proposedName, kit),
108
+ E(E(agoricNamesAdmin).lookupAdmin('issuer')).update(issuerName, issuer),
109
+ E(E(agoricNamesAdmin).lookupAdmin('brand')).update(issuerName, brand),
110
+ E(bankManager).addAsset(denom, issuerName, proposedName, kit),
100
111
  ]);
101
112
  };
102
113
 
@@ -119,10 +130,11 @@ export const registerScaledPriceAuthority = async (
119
130
  ) => {
120
131
  const {
121
132
  keyword,
122
- oracleBrand,
133
+ issuerName = keyword,
134
+ oracleBrand = issuerName,
123
135
  initialPrice: initialPriceRaw,
124
136
  } = interchainAssetOptions;
125
- assert.typeof(keyword, 'string');
137
+ assert.typeof(issuerName, 'string');
126
138
  assert.typeof(oracleBrand, 'string');
127
139
 
128
140
  const [
@@ -133,7 +145,7 @@ export const registerScaledPriceAuthority = async (
133
145
  ] = await Promise.all([
134
146
  priceAuthority,
135
147
  reserveThenGetNames(E(agoricNamesAdmin).lookupAdmin('brand'), [
136
- keyword,
148
+ issuerName,
137
149
  'IST',
138
150
  ]),
139
151
  reserveThenGetNames(E(agoricNamesAdmin).lookupAdmin('oracleBrand'), [
@@ -191,7 +203,7 @@ export const registerScaledPriceAuthority = async (
191
203
 
192
204
  const spaKit = await E(startUpgradable)({
193
205
  installation: scaledPriceAuthority,
194
- label: `scaledPriceAuthority-${keyword}`,
206
+ label: `scaledPriceAuthority-${issuerName}`,
195
207
  terms,
196
208
  });
197
209
 
@@ -233,12 +245,17 @@ export const addAssetToVault = async (
233
245
  },
234
246
  },
235
247
  ) => {
236
- const { keyword, oracleBrand } = interchainAssetOptions;
248
+ const {
249
+ keyword,
250
+ issuerName = keyword,
251
+ oracleBrand = issuerName,
252
+ } = interchainAssetOptions;
237
253
  assert.typeof(keyword, 'string');
254
+ assert.typeof(issuerName, 'string');
238
255
  assert.typeof(oracleBrand, 'string');
239
256
  const [interchainIssuer] = await reserveThenGetNames(
240
257
  E(agoricNamesAdmin).lookupAdmin('issuer'),
241
- [keyword],
258
+ [issuerName],
242
259
  );
243
260
 
244
261
  const oracleInstanceName = instanceNameFor(oracleBrand, 'USD');
@@ -248,7 +265,7 @@ export const addAssetToVault = async (
248
265
 
249
266
  const stable = await stableP;
250
267
  const vaultFactoryCreator = E.get(vaultFactoryKit).creatorFacet;
251
- await E(vaultFactoryCreator).addVaultType(interchainIssuer, oracleBrand, {
268
+ await E(vaultFactoryCreator).addVaultType(interchainIssuer, keyword, {
252
269
  debtLimit: AmountMath.make(stable, BigInt(debtLimitValue)),
253
270
  interestRate: makeRatio(interestRateValue, stable),
254
271
  // The rest of these we use safe defaults.