@agoric/builders 0.1.1-dev-5a4fc01.0 → 0.1.1-dev-7390224.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/builders",
3
- "version": "0.1.1-dev-5a4fc01.0+5a4fc01",
3
+ "version": "0.1.1-dev-7390224.0+7390224",
4
4
  "description": "Build scripts for proposals to an Agoric chain",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -23,14 +23,14 @@
23
23
  "author": "Agoric",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@agoric/ertp": "0.16.3-dev-5a4fc01.0+5a4fc01",
26
+ "@agoric/ertp": "0.16.3-dev-7390224.0+7390224",
27
27
  "@agoric/fast-usdc": "0.1.0",
28
- "@agoric/internal": "0.3.3-dev-5a4fc01.0+5a4fc01",
29
- "@agoric/notifier": "0.6.3-dev-5a4fc01.0+5a4fc01",
30
- "@agoric/smart-wallet": "0.5.4-dev-5a4fc01.0+5a4fc01",
31
- "@agoric/vat-data": "0.5.3-dev-5a4fc01.0+5a4fc01",
32
- "@agoric/vats": "0.15.2-dev-5a4fc01.0+5a4fc01",
33
- "@agoric/zoe": "0.26.3-dev-5a4fc01.0+5a4fc01",
28
+ "@agoric/internal": "0.3.3-dev-7390224.0+7390224",
29
+ "@agoric/notifier": "0.6.3-dev-7390224.0+7390224",
30
+ "@agoric/smart-wallet": "0.5.4-dev-7390224.0+7390224",
31
+ "@agoric/vat-data": "0.5.3-dev-7390224.0+7390224",
32
+ "@agoric/vats": "0.15.2-dev-7390224.0+7390224",
33
+ "@agoric/zoe": "0.26.3-dev-7390224.0+7390224",
34
34
  "@endo/bundle-source": "^3.4.2",
35
35
  "@endo/captp": "^4.4.2",
36
36
  "@endo/eventual-send": "^1.2.7",
@@ -43,14 +43,14 @@
43
43
  "import-meta-resolve": "^2.2.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@agoric/deploy-script-support": "0.10.4-dev-5a4fc01.0+5a4fc01",
47
- "@agoric/governance": "0.10.4-dev-5a4fc01.0+5a4fc01",
48
- "@agoric/inter-protocol": "0.16.2-dev-5a4fc01.0+5a4fc01",
49
- "@agoric/orchestration": "0.1.1-dev-5a4fc01.0+5a4fc01",
50
- "@agoric/store": "0.9.3-dev-5a4fc01.0+5a4fc01",
51
- "@agoric/swing-store": "0.9.2-dev-5a4fc01.0+5a4fc01",
52
- "@agoric/swingset-liveslots": "0.10.3-dev-5a4fc01.0+5a4fc01",
53
- "@agoric/time": "0.3.3-dev-5a4fc01.0+5a4fc01",
46
+ "@agoric/deploy-script-support": "0.10.4-dev-7390224.0+7390224",
47
+ "@agoric/governance": "0.10.4-dev-7390224.0+7390224",
48
+ "@agoric/inter-protocol": "0.16.2-dev-7390224.0+7390224",
49
+ "@agoric/orchestration": "0.1.1-dev-7390224.0+7390224",
50
+ "@agoric/store": "0.9.3-dev-7390224.0+7390224",
51
+ "@agoric/swing-store": "0.9.2-dev-7390224.0+7390224",
52
+ "@agoric/swingset-liveslots": "0.10.3-dev-7390224.0+7390224",
53
+ "@agoric/time": "0.3.3-dev-7390224.0+7390224",
54
54
  "@endo/errors": "^1.2.7",
55
55
  "ava": "^5.3.0",
56
56
  "c8": "^9.1.0"
@@ -83,5 +83,5 @@
83
83
  "typeCoverage": {
84
84
  "atLeast": 89.69
85
85
  },
86
- "gitHead": "5a4fc01b7f3226a5ad29eb1fd6a1c92cd25d4c5b"
86
+ "gitHead": "739022455dbfb7e7d7d90e8ae7cef948cde3e97a"
87
87
  }
@@ -6,7 +6,6 @@ import {
6
6
  getManifestForFastUSDC,
7
7
  } from '@agoric/fast-usdc/src/fast-usdc.start.js';
8
8
  import { toExternalConfig } from '@agoric/fast-usdc/src/utils/config-marshal.js';
9
- import { objectMap } from '@agoric/internal';
10
9
  import {
11
10
  multiplyBy,
12
11
  parseRatio,
@@ -22,16 +21,26 @@ import { parseArgs } from 'node:util';
22
21
 
23
22
  /** @type {ParseArgsConfig['options']} */
24
23
  const options = {
25
- contractFee: { type: 'string', default: '0.01' },
26
- poolFee: { type: 'string', default: '0.01' },
24
+ flatFee: { type: 'string', default: '0.01' },
25
+ variableRate: { type: 'string', default: '0.01' },
26
+ maxVariableFee: { type: 'string', default: '5' },
27
+ contractRate: { type: 'string', default: '0.2' },
27
28
  oracle: { type: 'string', multiple: true },
29
+ usdcDenom: {
30
+ type: 'string',
31
+ default:
32
+ 'ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9',
33
+ },
28
34
  };
29
35
  const oraclesRequiredUsage = 'use --oracle name:address ...';
30
36
  /**
31
37
  * @typedef {{
32
- * contractFee: string;
33
- * poolFee: string;
38
+ * flatFee: string;
39
+ * variableRate: string;
40
+ * maxVariableFee: string;
41
+ * contractRate: string;
34
42
  * oracle?: string[];
43
+ * usdcDenom: string;
35
44
  * }} FastUSDCOpts
36
45
  */
37
46
 
@@ -73,7 +82,7 @@ export default async (homeP, endowments) => {
73
82
  /** @type {{ values: FastUSDCOpts }} */
74
83
  // @ts-expect-error ensured by options
75
84
  const {
76
- values: { oracle: oracleArgs, ...fees },
85
+ values: { oracle: oracleArgs, usdcDenom, ...fees },
77
86
  } = parseArgs({ args: scriptArgs, options });
78
87
 
79
88
  const parseOracleArgs = () => {
@@ -88,15 +97,27 @@ export default async (homeP, endowments) => {
88
97
  );
89
98
  };
90
99
 
100
+ /** @param {string} numeral */
101
+ const toAmount = numeral => multiplyBy(unit, parseRatio(numeral, USDC));
102
+ /** @param {string} numeral */
103
+ const toRatio = numeral => parseRatio(numeral, USDC);
104
+ const parseFeeConfigArgs = () => {
105
+ const { flatFee, variableRate, maxVariableFee, contractRate } = fees;
106
+ return {
107
+ flat: toAmount(flatFee),
108
+ variableRate: toRatio(variableRate),
109
+ maxVariable: toAmount(maxVariableFee),
110
+ contractRate: toRatio(contractRate),
111
+ };
112
+ };
113
+
91
114
  /** @type {FastUSDCConfig} */
92
115
  const config = harden({
93
116
  oracles: parseOracleArgs(),
94
117
  terms: {
95
- ...objectMap(fees, numeral =>
96
- multiplyBy(unit, parseRatio(numeral, USDC)),
97
- ),
98
- usdcDenom: 'ibc/usdconagoric',
118
+ usdcDenom,
99
119
  },
120
+ feeConfig: parseFeeConfigArgs(),
100
121
  });
101
122
 
102
123
  await writeCoreEval('start-fast-usdc', utils =>