@agoric/builders 0.1.1-dev-d7e3856.0.d7e3856 → 0.1.1-dev-cbcb2b4.0.cbcb2b4

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-d7e3856.0.d7e3856",
3
+ "version": "0.1.1-dev-cbcb2b4.0.cbcb2b4",
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/client-utils": "0.1.1-dev-d7e3856.0.d7e3856",
27
- "@agoric/ertp": "0.16.3-dev-d7e3856.0.d7e3856",
28
- "@agoric/internal": "0.3.3-dev-d7e3856.0.d7e3856",
29
- "@agoric/notifier": "0.6.3-dev-d7e3856.0.d7e3856",
30
- "@agoric/smart-wallet": "0.5.4-dev-d7e3856.0.d7e3856",
31
- "@agoric/vat-data": "0.5.3-dev-d7e3856.0.d7e3856",
32
- "@agoric/vats": "0.15.2-dev-d7e3856.0.d7e3856",
33
- "@agoric/zoe": "0.26.3-dev-d7e3856.0.d7e3856",
26
+ "@agoric/client-utils": "0.1.1-dev-cbcb2b4.0.cbcb2b4",
27
+ "@agoric/ertp": "0.16.3-dev-cbcb2b4.0.cbcb2b4",
28
+ "@agoric/internal": "0.3.3-dev-cbcb2b4.0.cbcb2b4",
29
+ "@agoric/notifier": "0.6.3-dev-cbcb2b4.0.cbcb2b4",
30
+ "@agoric/smart-wallet": "0.5.4-dev-cbcb2b4.0.cbcb2b4",
31
+ "@agoric/vat-data": "0.5.3-dev-cbcb2b4.0.cbcb2b4",
32
+ "@agoric/vats": "0.15.2-dev-cbcb2b4.0.cbcb2b4",
33
+ "@agoric/zoe": "0.26.3-dev-cbcb2b4.0.cbcb2b4",
34
34
  "@endo/bundle-source": "^4.1.2",
35
35
  "@endo/captp": "^4.4.8",
36
36
  "@endo/eventual-send": "^1.3.4",
@@ -44,14 +44,14 @@
44
44
  "import-meta-resolve": "^4.1.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@agoric/deploy-script-support": "0.10.4-dev-d7e3856.0.d7e3856",
48
- "@agoric/governance": "0.10.4-dev-d7e3856.0.d7e3856",
49
- "@agoric/inter-protocol": "0.16.2-dev-d7e3856.0.d7e3856",
50
- "@agoric/orchestration": "0.1.1-dev-d7e3856.0.d7e3856",
51
- "@agoric/store": "0.9.3-dev-d7e3856.0.d7e3856",
52
- "@agoric/swing-store": "0.9.2-dev-d7e3856.0.d7e3856",
53
- "@agoric/swingset-liveslots": "0.10.3-dev-d7e3856.0.d7e3856",
54
- "@agoric/time": "0.3.3-dev-d7e3856.0.d7e3856",
47
+ "@agoric/deploy-script-support": "0.10.4-dev-cbcb2b4.0.cbcb2b4",
48
+ "@agoric/governance": "0.10.4-dev-cbcb2b4.0.cbcb2b4",
49
+ "@agoric/inter-protocol": "0.16.2-dev-cbcb2b4.0.cbcb2b4",
50
+ "@agoric/orchestration": "0.1.1-dev-cbcb2b4.0.cbcb2b4",
51
+ "@agoric/store": "0.9.3-dev-cbcb2b4.0.cbcb2b4",
52
+ "@agoric/swing-store": "0.9.2-dev-cbcb2b4.0.cbcb2b4",
53
+ "@agoric/swingset-liveslots": "0.10.3-dev-cbcb2b4.0.cbcb2b4",
54
+ "@agoric/time": "0.3.3-dev-cbcb2b4.0.cbcb2b4",
55
55
  "@endo/errors": "^1.2.13",
56
56
  "ava": "^5.3.0",
57
57
  "c8": "^10.1.3"
@@ -82,7 +82,7 @@
82
82
  "workerThreads": false
83
83
  },
84
84
  "typeCoverage": {
85
- "atLeast": 89.94
85
+ "atLeast": 90.26
86
86
  },
87
- "gitHead": "d7e38564101d310f8646d4dca377f518a75de579"
87
+ "gitHead": "cbcb2b45335dbc3e56238b85021ded728d402003"
88
88
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "consume": {
3
+ "agoricNames": "lookupBrands",
4
+ "bankManager": "getBankForAddress"
5
+ }
6
+ }
@@ -0,0 +1,67 @@
1
+ /* global E */
2
+ /// <reference types="@agoric/vats/src/core/core-eval-env" />
3
+ // @ts-check
4
+
5
+ // FIXME: we need to hardcode these values because the vbank reserve purse
6
+ // balance is not synced.
7
+ const DEFAULT_BLD_VALUE = 1_998n;
8
+ const DEFAULT_IST_VALUE = 202_020n;
9
+
10
+ const vbankReserveAddress = 'agoric1ae0lmtzlgrcnla9xjkpaarq5d5dfez63h3nucl';
11
+ const beneficiaryAddress = 'agoric18lfz3w97u72p4jq58gdn05ftdcv9rwz0ft5l2m';
12
+
13
+ /** @param {ChainBootstrapSpace & BootstrapPowers} powers */
14
+ const coreEval = async powers => {
15
+ console.warn('Core eval to transfer vbank/reserve to a beneficiary');
16
+ const {
17
+ consume: { agoricNames, bankManager },
18
+ } = powers;
19
+
20
+ console.warn('Looking up brands');
21
+ const BLD = await E(agoricNames).lookup('brand', 'BLD');
22
+ const IST = await E(agoricNames).lookup('brand', 'IST');
23
+
24
+ console.warn('Getting banks');
25
+ const reserveBank =
26
+ await E(bankManager).getBankForAddress(vbankReserveAddress);
27
+ const beneficiaryBank =
28
+ await E(bankManager).getBankForAddress(beneficiaryAddress);
29
+
30
+ console.warn('Getting reserve purses');
31
+ const reserveBLDPurse = await E(reserveBank).getPurse(BLD);
32
+ const reserveISTPurse = await E(reserveBank).getPurse(IST);
33
+
34
+ console.warn('Getting reserve balances');
35
+ const BLDAmount = await E(reserveBLDPurse).getCurrentAmount();
36
+ const reserveBLDBalance = harden({
37
+ ...BLDAmount,
38
+ value: BLDAmount.value || DEFAULT_BLD_VALUE,
39
+ });
40
+ const ISTAmount = await E(reserveISTPurse).getCurrentAmount();
41
+ const reserveISTBalance = harden({
42
+ ...ISTAmount,
43
+ value: ISTAmount.value || DEFAULT_IST_VALUE,
44
+ });
45
+ console.warn('reserve BLD balance', reserveBLDBalance);
46
+ console.warn('reserve IST balance', reserveISTBalance);
47
+
48
+ console.warn('Getting beneficiary purses');
49
+ const beneficiaryBLDPurse = await E(beneficiaryBank).getPurse(BLD);
50
+ const beneficiaryISTPurse = await E(beneficiaryBank).getPurse(IST);
51
+
52
+ console.warn('Withdrawing from reserve purses');
53
+ const BLDPayment = await E(reserveBLDPurse).withdraw(reserveBLDBalance);
54
+ const ISTPayment = await E(reserveISTPurse).withdraw(reserveISTBalance);
55
+
56
+ console.warn('Depositing into beneficiary purses');
57
+ const BLDTransferAmount = await E(beneficiaryBLDPurse).deposit(BLDPayment);
58
+ const ISTTransferAmount = await E(beneficiaryISTPurse).deposit(ISTPayment);
59
+
60
+ console.warn(
61
+ 'Done withdrawing reserve!',
62
+ BLDTransferAmount,
63
+ ISTTransferAmount,
64
+ );
65
+ };
66
+
67
+ coreEval;