@agoric/builders 0.1.1-dev-a66f6a1.0 → 0.1.1-dev-1645d7e.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-a66f6a1.0+a66f6a1",
3
+ "version": "0.1.1-dev-1645d7e.0+1645d7e",
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-a66f6a1.0+a66f6a1",
27
- "@agoric/fast-usdc": "0.1.1-dev-a66f6a1.0+a66f6a1",
28
- "@agoric/internal": "0.3.3-dev-a66f6a1.0+a66f6a1",
29
- "@agoric/notifier": "0.6.3-dev-a66f6a1.0+a66f6a1",
30
- "@agoric/smart-wallet": "0.5.4-dev-a66f6a1.0+a66f6a1",
31
- "@agoric/vat-data": "0.5.3-dev-a66f6a1.0+a66f6a1",
32
- "@agoric/vats": "0.15.2-dev-a66f6a1.0+a66f6a1",
33
- "@agoric/zoe": "0.26.3-dev-a66f6a1.0+a66f6a1",
26
+ "@agoric/ertp": "0.16.3-dev-1645d7e.0+1645d7e",
27
+ "@agoric/fast-usdc": "0.1.1-dev-1645d7e.0+1645d7e",
28
+ "@agoric/internal": "0.3.3-dev-1645d7e.0+1645d7e",
29
+ "@agoric/notifier": "0.6.3-dev-1645d7e.0+1645d7e",
30
+ "@agoric/smart-wallet": "0.5.4-dev-1645d7e.0+1645d7e",
31
+ "@agoric/vat-data": "0.5.3-dev-1645d7e.0+1645d7e",
32
+ "@agoric/vats": "0.15.2-dev-1645d7e.0+1645d7e",
33
+ "@agoric/zoe": "0.26.3-dev-1645d7e.0+1645d7e",
34
34
  "@endo/bundle-source": "^3.5.0",
35
35
  "@endo/captp": "^4.4.3",
36
36
  "@endo/eventual-send": "^1.2.8",
@@ -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-a66f6a1.0+a66f6a1",
47
- "@agoric/governance": "0.10.4-dev-a66f6a1.0+a66f6a1",
48
- "@agoric/inter-protocol": "0.16.2-dev-a66f6a1.0+a66f6a1",
49
- "@agoric/orchestration": "0.1.1-dev-a66f6a1.0+a66f6a1",
50
- "@agoric/store": "0.9.3-dev-a66f6a1.0+a66f6a1",
51
- "@agoric/swing-store": "0.9.2-dev-a66f6a1.0+a66f6a1",
52
- "@agoric/swingset-liveslots": "0.10.3-dev-a66f6a1.0+a66f6a1",
53
- "@agoric/time": "0.3.3-dev-a66f6a1.0+a66f6a1",
46
+ "@agoric/deploy-script-support": "0.10.4-dev-1645d7e.0+1645d7e",
47
+ "@agoric/governance": "0.10.4-dev-1645d7e.0+1645d7e",
48
+ "@agoric/inter-protocol": "0.16.2-dev-1645d7e.0+1645d7e",
49
+ "@agoric/orchestration": "0.1.1-dev-1645d7e.0+1645d7e",
50
+ "@agoric/store": "0.9.3-dev-1645d7e.0+1645d7e",
51
+ "@agoric/swing-store": "0.9.2-dev-1645d7e.0+1645d7e",
52
+ "@agoric/swingset-liveslots": "0.10.3-dev-1645d7e.0+1645d7e",
53
+ "@agoric/time": "0.3.3-dev-1645d7e.0+1645d7e",
54
54
  "@endo/errors": "^1.2.8",
55
55
  "ava": "^5.3.0",
56
56
  "c8": "^10.1.2"
@@ -83,5 +83,5 @@
83
83
  "typeCoverage": {
84
84
  "atLeast": 90.93
85
85
  },
86
- "gitHead": "a66f6a1408016746f4f480241f3d6efa53732841"
86
+ "gitHead": "1645d7e8a3194f56889e91df38a31c1a900905bb"
87
87
  }
@@ -0,0 +1,61 @@
1
+ import { parseArgs } from 'node:util';
2
+ import { getManifestForUpdateFastUsdcPolicy } from '@agoric/fast-usdc/src/fast-usdc-policy.core.js';
3
+ import { toExternalConfig } from '@agoric/fast-usdc/src/utils/config-marshal.js';
4
+ import { FeedPolicyShape } from '@agoric/fast-usdc/src/type-guards.js';
5
+ import { makeHelpers } from '@agoric/deploy-script-support';
6
+
7
+ /**
8
+ * @import {CoreEvalBuilder, DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js'
9
+ * @import {ParseArgsConfig} from 'node:util'
10
+ * @import {FastUSDCConfig} from '@agoric/fast-usdc/src/types.js'
11
+ */
12
+
13
+ /** @type {ParseArgsConfig['options']} */
14
+ const options = {
15
+ feedPolicy: { type: 'string' },
16
+ };
17
+ const feedPolicyUsage = 'use --feedPolicy <policy> ...';
18
+
19
+ /**
20
+ * @typedef {{
21
+ * feedPolicy?: string;
22
+ * }} FastUSDCUpdateOpts
23
+ */
24
+
25
+ /** @type {CoreEvalBuilder} */
26
+ export const updateProposalBuilder = async (
27
+ _utils,
28
+ /** @type {FastUSDCConfig} */ config,
29
+ ) => {
30
+ return harden({
31
+ sourceSpec: '@agoric/fast-usdc/src/fast-usdc-policy.core.js',
32
+ /** @type {[string, Parameters<typeof getManifestForUpdateFastUsdcPolicy>[1]]} */
33
+ getManifestCall: [
34
+ getManifestForUpdateFastUsdcPolicy.name,
35
+ {
36
+ options: toExternalConfig(
37
+ config,
38
+ {},
39
+ harden({ feedPolicy: FeedPolicyShape }),
40
+ ),
41
+ },
42
+ ],
43
+ });
44
+ };
45
+
46
+ /** @type {DeployScriptFunction} */
47
+ export default async (homeP, endowments) => {
48
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
49
+ const {
50
+ values: { feedPolicy },
51
+ } = parseArgs({ args: endowments.scriptArgs, options });
52
+
53
+ const parseFeedPolicy = () => {
54
+ if (typeof feedPolicy !== 'string') throw Error(feedPolicyUsage);
55
+ return JSON.parse(feedPolicy);
56
+ };
57
+ const config = harden({ feedPolicy: parseFeedPolicy() });
58
+ await writeCoreEval('eval-fast-usdc-policy-update', utils =>
59
+ updateProposalBuilder(utils, config),
60
+ );
61
+ };
@@ -6,8 +6,7 @@ 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 { denomHash, withChainCapabilities } from '@agoric/orchestration';
10
- import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js';
9
+ import { configurations } from '@agoric/fast-usdc/src/utils/deploy-config.js';
11
10
  import {
12
11
  multiplyBy,
13
12
  parseRatio,
@@ -18,146 +17,11 @@ import { parseArgs } from 'node:util';
18
17
  /**
19
18
  * @import {CoreEvalBuilder, DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js'
20
19
  * @import {ParseArgsConfig} from 'node:util'
21
- * @import {FastUSDCConfig} from '@agoric/fast-usdc/src/fast-usdc.start.js'
22
- * @import {Passable} from '@endo/marshal';
23
- * @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
20
+ * @import {FastUSDCConfig} from '@agoric/fast-usdc/src/types.js'
24
21
  */
25
22
 
26
23
  const { keys } = Object;
27
24
 
28
- /** @type {[Denom, DenomDetail & { brandKey?: string}][]} */
29
- const defaultAssetInfo = [
30
- [
31
- 'uusdc',
32
- {
33
- baseName: 'noble',
34
- chainName: 'noble',
35
- baseDenom: 'uusdc',
36
- },
37
- ],
38
- [
39
- `ibc/${denomHash({ denom: 'uusdc', channelId: fetchedChainInfo.agoric.connections['noble-1'].transferChannel.channelId })}`,
40
- {
41
- baseName: 'noble',
42
- chainName: 'agoric',
43
- baseDenom: 'uusdc',
44
- brandKey: 'USDC',
45
- },
46
- ],
47
- [
48
- `ibc/${denomHash({ denom: 'uusdc', channelId: fetchedChainInfo.osmosis.connections['noble-1'].transferChannel.channelId })}`,
49
- {
50
- baseName: 'noble',
51
- chainName: 'osmosis',
52
- baseDenom: 'uusdc',
53
- },
54
- ],
55
- ];
56
-
57
- /**
58
- * @type {Record<string, Pick<FastUSDCConfig, 'oracles' | 'feedPolicy' | 'chainInfo' | 'assetInfo' >>}
59
- *
60
- * TODO: determine OCW operator addresses
61
- * meanwhile, use price oracle addresses (from updatePriceFeeds.js).
62
- */
63
- const configurations = {
64
- A3P_INTEGRATION: {
65
- oracles: {
66
- gov1: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q',
67
- gov2: 'agoric1wrfh296eu2z34p6pah7q04jjuyj3mxu9v98277',
68
- gov3: 'agoric1ydzxwh6f893jvpaslmaz6l8j2ulup9a7x8qvvq',
69
- },
70
- feedPolicy: {
71
- nobleAgoricChannelId: 'TODO',
72
- nobleDomainId: 4,
73
- chainPolicies: {
74
- Arbitrum: {
75
- cctpTokenMessengerAddress:
76
- '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
77
- chainId: 42161,
78
- confirmations: 2,
79
- nobleContractAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
80
- },
81
- },
82
- },
83
- chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
84
- withChainCapabilities(fetchedChainInfo)
85
- ),
86
- assetInfo: defaultAssetInfo,
87
- },
88
- MAINNET: {
89
- oracles: {
90
- '01node': 'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8',
91
- 'Simply Staking': 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr',
92
- P2P: 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj',
93
- },
94
- feedPolicy: {
95
- nobleAgoricChannelId: 'channel-21',
96
- nobleDomainId: 4,
97
- chainPolicies: {
98
- Arbitrum: {
99
- cctpTokenMessengerAddress:
100
- '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
101
- chainId: 42161,
102
- confirmations: 2,
103
- nobleContractAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
104
- },
105
- },
106
- },
107
- chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
108
- withChainCapabilities(fetchedChainInfo)
109
- ),
110
- assetInfo: defaultAssetInfo,
111
- },
112
- DEVNET: {
113
- oracles: {
114
- DSRV: 'agoric1lw4e4aas9q84tq0q92j85rwjjjapf8dmnllnft',
115
- Stakin: 'agoric1zj6vrrrjq4gsyr9lw7dplv4vyejg3p8j2urm82',
116
- '01node': 'agoric1ra0g6crtsy6r3qnpu7ruvm7qd4wjnznyzg5nu4',
117
- 'Simply Staking': 'agoric1qj07c7vfk3knqdral0sej7fa6eavkdn8vd8etf',
118
- P2P: 'agoric10vjkvkmpp9e356xeh6qqlhrny2htyzp8hf88fk',
119
- },
120
- feedPolicy: {
121
- nobleAgoricChannelId: 'TODO',
122
- nobleDomainId: 4,
123
- chainPolicies: {
124
- Arbitrum: {
125
- cctpTokenMessengerAddress: '0xTODO',
126
- chainId: 421614,
127
- confirmations: 2,
128
- nobleContractAddress: '0xTODO',
129
- },
130
- },
131
- },
132
- chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
133
- withChainCapabilities(fetchedChainInfo) // TODO: use devnet values
134
- ),
135
- assetInfo: defaultAssetInfo, // TODO: use emerynet values
136
- },
137
- EMERYNET: {
138
- oracles: {
139
- gov1: 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce',
140
- gov2: 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang',
141
- },
142
- feedPolicy: {
143
- nobleAgoricChannelId: 'TODO',
144
- nobleDomainId: 4,
145
- chainPolicies: {
146
- Arbitrum: {
147
- cctpTokenMessengerAddress: '0xTODO',
148
- chainId: 421614,
149
- confirmations: 2,
150
- nobleContractAddress: '0xTODO',
151
- },
152
- },
153
- },
154
- chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
155
- withChainCapabilities(fetchedChainInfo) // TODO: use emerynet values
156
- ),
157
- assetInfo: defaultAssetInfo, // TODO: use emerynet values
158
- },
159
- };
160
-
161
25
  /** @type {ParseArgsConfig['options']} */
162
26
  const options = {
163
27
  flatFee: { type: 'string', default: '0.01' },
@@ -166,6 +30,7 @@ const options = {
166
30
  contractRate: { type: 'string', default: '0.2' },
167
31
  net: { type: 'string' },
168
32
  oracle: { type: 'string', multiple: true },
33
+ feedPolicy: { type: 'string' },
169
34
  usdcDenom: {
170
35
  type: 'string',
171
36
  default:
@@ -178,9 +43,9 @@ const oraclesUsage = 'use --oracle name:address ...';
178
43
 
179
44
  const feedPolicyUsage = 'use --feedPolicy <policy> ...';
180
45
 
181
- const chainInfoUsage = 'use --chainInfo chainName:CosmosChainInfo ...';
46
+ const chainInfoUsage = 'use --chainInfo {chainName:CosmosChainInfo, ...}';
182
47
  const assetInfoUsage =
183
- 'use --assetInfo denom:DenomInfo & {brandKey?: string} ...';
48
+ 'use --assetInfo { denom:DenomInfo & {brandKey?: string} ... }';
184
49
 
185
50
  /**
186
51
  * @typedef {{