@agoric/builders 0.1.1-dev-1cd6408.0 → 0.1.1-dev-2a16ddd.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 +17 -17
- package/scripts/inter-protocol/price-feed-core.js +1 -1
- package/scripts/vats/priceFeedSupport.js +62 -0
- package/scripts/vats/updateAtomPriceFeed.js +21 -0
- package/scripts/vats/updateStAtomPriceFeed.js +21 -0
- package/scripts/vats/updateStOsmoPriceFeed.js +21 -0
- package/scripts/vats/updateStTiaPriceFeed.js +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/builders",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-2a16ddd.0+2a16ddd",
|
|
4
4
|
"description": "Build scripts for proposals to an Agoric chain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"author": "Agoric",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
27
|
-
"@agoric/internal": "0.3.3-dev-
|
|
28
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
29
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
30
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
31
|
-
"@agoric/vats": "0.15.2-dev-
|
|
32
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-2a16ddd.0+2a16ddd",
|
|
27
|
+
"@agoric/internal": "0.3.3-dev-2a16ddd.0+2a16ddd",
|
|
28
|
+
"@agoric/notifier": "0.6.3-dev-2a16ddd.0+2a16ddd",
|
|
29
|
+
"@agoric/smart-wallet": "0.5.4-dev-2a16ddd.0+2a16ddd",
|
|
30
|
+
"@agoric/vat-data": "0.5.3-dev-2a16ddd.0+2a16ddd",
|
|
31
|
+
"@agoric/vats": "0.15.2-dev-2a16ddd.0+2a16ddd",
|
|
32
|
+
"@agoric/zoe": "0.26.3-dev-2a16ddd.0+2a16ddd",
|
|
33
33
|
"@endo/bundle-source": "^3.1.0",
|
|
34
34
|
"@endo/captp": "^4.0.4",
|
|
35
35
|
"@endo/eventual-send": "^1.1.2",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"import-meta-resolve": "^2.2.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@agoric/assert": "0.6.1-dev-
|
|
45
|
-
"@agoric/deploy-script-support": "0.10.4-dev-
|
|
46
|
-
"@agoric/governance": "0.10.4-dev-
|
|
47
|
-
"@agoric/inter-protocol": "0.16.2-dev-
|
|
48
|
-
"@agoric/store": "0.9.3-dev-
|
|
49
|
-
"@agoric/swing-store": "0.9.2-dev-
|
|
50
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
51
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
+
"@agoric/assert": "0.6.1-dev-2a16ddd.0+2a16ddd",
|
|
45
|
+
"@agoric/deploy-script-support": "0.10.4-dev-2a16ddd.0+2a16ddd",
|
|
46
|
+
"@agoric/governance": "0.10.4-dev-2a16ddd.0+2a16ddd",
|
|
47
|
+
"@agoric/inter-protocol": "0.16.2-dev-2a16ddd.0+2a16ddd",
|
|
48
|
+
"@agoric/store": "0.9.3-dev-2a16ddd.0+2a16ddd",
|
|
49
|
+
"@agoric/swing-store": "0.9.2-dev-2a16ddd.0+2a16ddd",
|
|
50
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-2a16ddd.0+2a16ddd",
|
|
51
|
+
"@agoric/time": "0.3.3-dev-2a16ddd.0+2a16ddd",
|
|
52
52
|
"ava": "^5.3.0",
|
|
53
53
|
"c8": "^9.1.0"
|
|
54
54
|
},
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"typeCoverage": {
|
|
81
81
|
"atLeast": 73.8
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "2a16ddd09a7e81241548e7a29e13c41cae065709"
|
|
84
84
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* global process */
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_CONTRACT_TERMS } from '../inter-protocol/price-feed-core.js';
|
|
4
|
+
|
|
5
|
+
const ORACLE_ADDRESSES = [
|
|
6
|
+
// XXX These are the oracle addresses. They must be provided before the chain
|
|
7
|
+
// is running, which means they must be known ahead of time.
|
|
8
|
+
// see https://github.com/Agoric/agoric-3-proposals/issues/5
|
|
9
|
+
'agoric1lu9hh5vgx05hmlpfu47hukershgdxctk6l5s05',
|
|
10
|
+
'agoric15lpnq2mjsdhtztf6khp7mrsq66hyrssspy92pd',
|
|
11
|
+
'agoric1mwm224epc4l3pjcz7qsxnudcuktpynwkmnfqfp',
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* modified copy of ../inter-protocol/price-feed-core.js
|
|
16
|
+
*
|
|
17
|
+
* @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder}
|
|
18
|
+
*/
|
|
19
|
+
export const priceFeedProposalBuilder = async (
|
|
20
|
+
{ publishRef, install },
|
|
21
|
+
options = {},
|
|
22
|
+
) => {
|
|
23
|
+
const {
|
|
24
|
+
AGORIC_INSTANCE_NAME,
|
|
25
|
+
IN_BRAND_LOOKUP,
|
|
26
|
+
IN_BRAND_NAME = IN_BRAND_LOOKUP[IN_BRAND_LOOKUP.length - 1],
|
|
27
|
+
} = options;
|
|
28
|
+
|
|
29
|
+
const { GOV1ADDR, GOV2ADDR, GOV3ADDR } = process.env;
|
|
30
|
+
const oracleAddresses =
|
|
31
|
+
GOV1ADDR || GOV2ADDR || GOV3ADDR
|
|
32
|
+
? [GOV1ADDR, GOV2ADDR, GOV3ADDR].filter(x => x)
|
|
33
|
+
: ORACLE_ADDRESSES;
|
|
34
|
+
assert(Array.isArray(oracleAddresses), 'oracleAddresses array is required');
|
|
35
|
+
|
|
36
|
+
assert(AGORIC_INSTANCE_NAME, 'AGORIC_INSTANCE_NAME is required');
|
|
37
|
+
|
|
38
|
+
assert.equal(IN_BRAND_LOOKUP[0], 'agoricNames');
|
|
39
|
+
assert(IN_BRAND_NAME, 'brandIn is required');
|
|
40
|
+
|
|
41
|
+
return harden({
|
|
42
|
+
sourceSpec: '@agoric/inter-protocol/src/proposals/price-feed-proposal.js',
|
|
43
|
+
getManifestCall: [
|
|
44
|
+
'getManifestForPriceFeed',
|
|
45
|
+
{
|
|
46
|
+
AGORIC_INSTANCE_NAME,
|
|
47
|
+
contractTerms: DEFAULT_CONTRACT_TERMS,
|
|
48
|
+
oracleAddresses,
|
|
49
|
+
IN_BRAND_NAME,
|
|
50
|
+
IN_BRAND_DECIMALS: 6,
|
|
51
|
+
OUT_BRAND_DECIMALS: 4,
|
|
52
|
+
OUT_BRAND_NAME: 'USD',
|
|
53
|
+
priceAggregatorRef: publishRef(
|
|
54
|
+
install(
|
|
55
|
+
'@agoric/inter-protocol/src/price/fluxAggregatorContract.js',
|
|
56
|
+
'../bundles/bundle-fluxAggregatorKit.js',
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { priceFeedProposalBuilder } from './priceFeedSupport.js';
|
|
3
|
+
|
|
4
|
+
const OPTIONS = {
|
|
5
|
+
AGORIC_INSTANCE_NAME: 'ATOM-USD price feed',
|
|
6
|
+
IN_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'ATOM'],
|
|
7
|
+
OUT_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'USD'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder}
|
|
12
|
+
*/
|
|
13
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
14
|
+
return priceFeedProposalBuilder({ publishRef, install }, OPTIONS);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default async (homeP, endowments) => {
|
|
18
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
19
|
+
|
|
20
|
+
await writeCoreProposal('atomPriceFeed', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { priceFeedProposalBuilder } from './priceFeedSupport.js';
|
|
3
|
+
|
|
4
|
+
const OPTIONS = {
|
|
5
|
+
AGORIC_INSTANCE_NAME: 'stATOM-USD price feed',
|
|
6
|
+
IN_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'stAtom'],
|
|
7
|
+
OUT_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'USD'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder}
|
|
12
|
+
*/
|
|
13
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
14
|
+
return priceFeedProposalBuilder({ publishRef, install }, OPTIONS);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default async (homeP, endowments) => {
|
|
18
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
19
|
+
|
|
20
|
+
await writeCoreProposal('stAtomPriceFeed', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { priceFeedProposalBuilder } from './priceFeedSupport.js';
|
|
3
|
+
|
|
4
|
+
const OPTIONS = {
|
|
5
|
+
AGORIC_INSTANCE_NAME: 'stOSMO-USD price feed',
|
|
6
|
+
IN_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'stOSMO'],
|
|
7
|
+
OUT_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'USD'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder}
|
|
12
|
+
*/
|
|
13
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
14
|
+
return priceFeedProposalBuilder({ publishRef, install }, OPTIONS);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default async (homeP, endowments) => {
|
|
18
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
19
|
+
|
|
20
|
+
await writeCoreProposal('stOsmoPriceFeed', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { priceFeedProposalBuilder } from './priceFeedSupport.js';
|
|
3
|
+
|
|
4
|
+
const OPTIONS = {
|
|
5
|
+
AGORIC_INSTANCE_NAME: 'stTIA-USD price feed',
|
|
6
|
+
IN_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'stTIA'],
|
|
7
|
+
OUT_BRAND_LOOKUP: ['agoricNames', 'oracleBrand', 'USD'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder}
|
|
12
|
+
*/
|
|
13
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
14
|
+
return priceFeedProposalBuilder({ publishRef, install }, OPTIONS);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default async (homeP, endowments) => {
|
|
18
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
19
|
+
|
|
20
|
+
await writeCoreProposal('stTiaPriceFeed', defaultProposalBuilder);
|
|
21
|
+
};
|