@agoric/builders 0.1.1-dev-c7a5fd7.0 → 0.1.1-dev-c3009d4.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/testing/start-auto-stake-it.js +126 -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-c3009d4.0+c3009d4",
|
|
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-c3009d4.0+c3009d4",
|
|
27
|
+
"@agoric/internal": "0.3.3-dev-c3009d4.0+c3009d4",
|
|
28
|
+
"@agoric/notifier": "0.6.3-dev-c3009d4.0+c3009d4",
|
|
29
|
+
"@agoric/smart-wallet": "0.5.4-dev-c3009d4.0+c3009d4",
|
|
30
|
+
"@agoric/vat-data": "0.5.3-dev-c3009d4.0+c3009d4",
|
|
31
|
+
"@agoric/vats": "0.15.2-dev-c3009d4.0+c3009d4",
|
|
32
|
+
"@agoric/zoe": "0.26.3-dev-c3009d4.0+c3009d4",
|
|
33
33
|
"@endo/bundle-source": "^3.2.3",
|
|
34
34
|
"@endo/captp": "^4.2.0",
|
|
35
35
|
"@endo/eventual-send": "^1.2.2",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"import-meta-resolve": "^2.2.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@agoric/deploy-script-support": "0.10.4-dev-
|
|
45
|
-
"@agoric/governance": "0.10.4-dev-
|
|
46
|
-
"@agoric/inter-protocol": "0.16.2-dev-
|
|
47
|
-
"@agoric/orchestration": "0.1.1-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/deploy-script-support": "0.10.4-dev-c3009d4.0+c3009d4",
|
|
45
|
+
"@agoric/governance": "0.10.4-dev-c3009d4.0+c3009d4",
|
|
46
|
+
"@agoric/inter-protocol": "0.16.2-dev-c3009d4.0+c3009d4",
|
|
47
|
+
"@agoric/orchestration": "0.1.1-dev-c3009d4.0+c3009d4",
|
|
48
|
+
"@agoric/store": "0.9.3-dev-c3009d4.0+c3009d4",
|
|
49
|
+
"@agoric/swing-store": "0.9.2-dev-c3009d4.0+c3009d4",
|
|
50
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-c3009d4.0+c3009d4",
|
|
51
|
+
"@agoric/time": "0.3.3-dev-c3009d4.0+c3009d4",
|
|
52
52
|
"@endo/errors": "^1.2.2",
|
|
53
53
|
"ava": "^5.3.0",
|
|
54
54
|
"c8": "^9.1.0"
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"typeCoverage": {
|
|
82
82
|
"atLeast": 76.03
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "c3009d4f42964b2810efe09d38e14bde66c9e9b6"
|
|
85
85
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A proposal to start the auto-stake-it contract.
|
|
3
|
+
*
|
|
4
|
+
* AutoStakeIt allows users to to create an auto-forwarding address that
|
|
5
|
+
* transfers and stakes tokens on a remote chain when received.
|
|
6
|
+
*/
|
|
7
|
+
import { makeTracer } from '@agoric/internal';
|
|
8
|
+
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
9
|
+
import { E } from '@endo/far';
|
|
10
|
+
import { deeplyFulfilled } from '@endo/marshal';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @import {AutoStakeItSF} from '@agoric/orchestration/src/examples/auto-stake-it.contract.js';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const contractName = 'autoAutoStakeIt';
|
|
17
|
+
const trace = makeTracer(contractName, true);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {BootstrapPowers} powers
|
|
21
|
+
*/
|
|
22
|
+
export const startAutoStakeIt = async ({
|
|
23
|
+
consume: {
|
|
24
|
+
agoricNames,
|
|
25
|
+
board,
|
|
26
|
+
chainStorage,
|
|
27
|
+
chainTimerService,
|
|
28
|
+
cosmosInterchainService,
|
|
29
|
+
localchain,
|
|
30
|
+
startUpgradable,
|
|
31
|
+
},
|
|
32
|
+
installation: {
|
|
33
|
+
// @ts-expect-error not a WellKnownName
|
|
34
|
+
consume: { [contractName]: installation },
|
|
35
|
+
},
|
|
36
|
+
instance: {
|
|
37
|
+
// @ts-expect-error not a WellKnownName
|
|
38
|
+
produce: { [contractName]: produceInstance },
|
|
39
|
+
},
|
|
40
|
+
}) => {
|
|
41
|
+
trace(`start ${contractName}`);
|
|
42
|
+
await null;
|
|
43
|
+
|
|
44
|
+
const storageNode = await makeStorageNodeChild(chainStorage, contractName);
|
|
45
|
+
const marshaller = await E(board).getPublishingMarshaller();
|
|
46
|
+
|
|
47
|
+
/** @type {StartUpgradableOpts<AutoStakeItSF>} */
|
|
48
|
+
const startOpts = {
|
|
49
|
+
label: 'autoAutoStakeIt',
|
|
50
|
+
installation,
|
|
51
|
+
terms: undefined,
|
|
52
|
+
privateArgs: await deeplyFulfilled(
|
|
53
|
+
harden({
|
|
54
|
+
agoricNames,
|
|
55
|
+
orchestrationService: cosmosInterchainService,
|
|
56
|
+
localchain,
|
|
57
|
+
storageNode,
|
|
58
|
+
marshaller,
|
|
59
|
+
timerService: chainTimerService,
|
|
60
|
+
}),
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const { instance } = await E(startUpgradable)(startOpts);
|
|
65
|
+
produceInstance.resolve(instance);
|
|
66
|
+
};
|
|
67
|
+
harden(startAutoStakeIt);
|
|
68
|
+
|
|
69
|
+
export const getManifestForContract = (
|
|
70
|
+
{ restoreRef },
|
|
71
|
+
{ installKeys, ...options },
|
|
72
|
+
) => {
|
|
73
|
+
return {
|
|
74
|
+
manifest: {
|
|
75
|
+
[startAutoStakeIt.name]: {
|
|
76
|
+
consume: {
|
|
77
|
+
agoricNames: true,
|
|
78
|
+
board: true,
|
|
79
|
+
chainStorage: true,
|
|
80
|
+
chainTimerService: true,
|
|
81
|
+
cosmosInterchainService: true,
|
|
82
|
+
localchain: true,
|
|
83
|
+
startUpgradable: true,
|
|
84
|
+
},
|
|
85
|
+
installation: {
|
|
86
|
+
consume: { [contractName]: true },
|
|
87
|
+
},
|
|
88
|
+
instance: {
|
|
89
|
+
produce: { [contractName]: true },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
installations: {
|
|
94
|
+
[contractName]: restoreRef(installKeys[contractName]),
|
|
95
|
+
},
|
|
96
|
+
options,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
101
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
102
|
+
return harden({
|
|
103
|
+
// Somewhat unorthodox, source the exports from this builder module
|
|
104
|
+
sourceSpec: '@agoric/builders/scripts/testing/start-auto-stake-it.js',
|
|
105
|
+
getManifestCall: [
|
|
106
|
+
'getManifestForContract',
|
|
107
|
+
{
|
|
108
|
+
installKeys: {
|
|
109
|
+
autoAutoStakeIt: publishRef(
|
|
110
|
+
install(
|
|
111
|
+
'@agoric/orchestration/src/examples/auto-stake-it.contract.js',
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default async (homeP, endowments) => {
|
|
121
|
+
// import dynamically so the module can work in CoreEval environment
|
|
122
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
123
|
+
const { makeHelpers } = dspModule;
|
|
124
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
125
|
+
await writeCoreEval(startAutoStakeIt.name, defaultProposalBuilder);
|
|
126
|
+
};
|