@agoric/vats 0.15.2-dev-c7a5fd7.0 → 0.15.2-dev-81ac381.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 +16 -16
- package/src/transfer.d.ts +7 -3
- package/src/transfer.d.ts.map +1 -1
- package/src/transfer.js +2 -0
- package/src/types.d.ts +29 -0
- package/src/vat-transfer.d.ts +2 -2
- package/src/vat-transfer.d.ts.map +1 -1
- package/tools/fake-bridge.d.ts.map +1 -1
- package/tools/fake-bridge.js +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/vats",
|
|
3
|
-
"version": "0.15.2-dev-
|
|
3
|
+
"version": "0.15.2-dev-81ac381.0+81ac381",
|
|
4
4
|
"description": "Agoric's Vat library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
26
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
27
|
-
"@agoric/governance": "0.10.4-dev-
|
|
28
|
-
"@agoric/internal": "0.3.3-dev-
|
|
29
|
-
"@agoric/network": "0.1.1-dev-
|
|
30
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
31
|
-
"@agoric/store": "0.9.3-dev-
|
|
32
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
33
|
-
"@agoric/time": "0.3.3-dev-
|
|
34
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
35
|
-
"@agoric/vow": "0.1.1-dev-
|
|
36
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
37
|
-
"@agoric/zone": "0.2.3-dev-
|
|
25
|
+
"@agoric/cosmic-proto": "0.4.1-dev-81ac381.0+81ac381",
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-81ac381.0+81ac381",
|
|
27
|
+
"@agoric/governance": "0.10.4-dev-81ac381.0+81ac381",
|
|
28
|
+
"@agoric/internal": "0.3.3-dev-81ac381.0+81ac381",
|
|
29
|
+
"@agoric/network": "0.1.1-dev-81ac381.0+81ac381",
|
|
30
|
+
"@agoric/notifier": "0.6.3-dev-81ac381.0+81ac381",
|
|
31
|
+
"@agoric/store": "0.9.3-dev-81ac381.0+81ac381",
|
|
32
|
+
"@agoric/swingset-vat": "0.32.3-dev-81ac381.0+81ac381",
|
|
33
|
+
"@agoric/time": "0.3.3-dev-81ac381.0+81ac381",
|
|
34
|
+
"@agoric/vat-data": "0.5.3-dev-81ac381.0+81ac381",
|
|
35
|
+
"@agoric/vow": "0.1.1-dev-81ac381.0+81ac381",
|
|
36
|
+
"@agoric/zoe": "0.26.3-dev-81ac381.0+81ac381",
|
|
37
|
+
"@agoric/zone": "0.2.3-dev-81ac381.0+81ac381",
|
|
38
38
|
"@endo/errors": "^1.2.2",
|
|
39
39
|
"@endo/far": "^1.1.2",
|
|
40
40
|
"@endo/import-bundle": "^1.1.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"jessie.js": "^0.3.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
49
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-81ac381.0+81ac381",
|
|
50
50
|
"@endo/bundle-source": "^3.2.3",
|
|
51
51
|
"@endo/init": "^1.1.2",
|
|
52
52
|
"ava": "^5.3.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"typeCoverage": {
|
|
79
79
|
"atLeast": 91.41
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "81ac38153db929618831ac19f57c019769d3cbef"
|
|
82
82
|
}
|
package/src/transfer.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ export function prepareTransferTools(zone: import("@agoric/base-zone").Zone, vow
|
|
|
8
8
|
};
|
|
9
9
|
interceptorFactory: {
|
|
10
10
|
wrapApp: (tap: globalThis.ERef<TargetApp>, targetHost: globalThis.ERef<TargetHost>, isActiveTap?: boolean | undefined) => import("@endo/exo").Guarded<{
|
|
11
|
-
|
|
11
|
+
/** @param {VTransferIBCEvent} obj */
|
|
12
|
+
receiveUpcall(obj: VTransferIBCEvent): Promise<import("@agoric/vow").Vow<unknown> | undefined>;
|
|
12
13
|
}>;
|
|
13
14
|
};
|
|
14
15
|
transferMiddleware: {
|
|
@@ -42,6 +43,7 @@ export type TransferMiddlewareKit = ReturnType<ReturnType<typeof prepareTransfer
|
|
|
42
43
|
export type TransferMiddleware = TransferMiddlewareKit["transferMiddleware"];
|
|
43
44
|
import type { TargetApp } from './bridge-target.js';
|
|
44
45
|
import type { TargetHost } from './bridge-target.js';
|
|
46
|
+
import type { VTransferIBCEvent } from './types.js';
|
|
45
47
|
/**
|
|
46
48
|
* @callback RegisterTap
|
|
47
49
|
* @param {string} target String identifying the bridge target.
|
|
@@ -72,7 +74,8 @@ declare function prepareTransferMiddlewareKit(zone: import("@agoric/base-zone").
|
|
|
72
74
|
};
|
|
73
75
|
interceptorFactory: {
|
|
74
76
|
wrapApp: (tap: globalThis.ERef<TargetApp>, targetHost: globalThis.ERef<TargetHost>, isActiveTap?: boolean | undefined) => import("@endo/exo").Guarded<{
|
|
75
|
-
|
|
77
|
+
/** @param {VTransferIBCEvent} obj */
|
|
78
|
+
receiveUpcall(obj: VTransferIBCEvent): Promise<import("@agoric/vow").Vow<unknown> | undefined>;
|
|
76
79
|
}>;
|
|
77
80
|
};
|
|
78
81
|
transferMiddleware: {
|
|
@@ -105,7 +108,8 @@ declare function prepareTransferMiddlewareKit(zone: import("@agoric/base-zone").
|
|
|
105
108
|
* @param {import('@agoric/vow').VowTools} vowTools
|
|
106
109
|
*/
|
|
107
110
|
declare function prepareTransferInterceptor(zone: import("@agoric/base-zone").Zone, vowTools: import("@agoric/vow").VowTools): (tap: globalThis.ERef<TargetApp>, targetHost: globalThis.ERef<TargetHost>, isActiveTap?: boolean | undefined) => import("@endo/exo").Guarded<{
|
|
108
|
-
|
|
111
|
+
/** @param {VTransferIBCEvent} obj */
|
|
112
|
+
receiveUpcall(obj: VTransferIBCEvent): Promise<import("@agoric/vow").Vow<unknown> | undefined>;
|
|
109
113
|
}>;
|
|
110
114
|
export {};
|
|
111
115
|
//# sourceMappingURL=transfer.d.ts.map
|
package/src/transfer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["transfer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["transfer.js"],"names":[],"mappings":"AAiQO,2CAHI,OAAO,mBAAmB,EAAE,IAAI,YAChC,OAAO,aAAa,EAAE,QAAQ;;;YArDjC;;eAEG;kCADQ,OAAO,iBAAiB,EAAE,cAAc;;;;gBAvJnD,qCAAqC;mCAAzB,iBAAiB;;;;YAiK7B;;;;;;eAMG;gCAnDA,MAAM,OACN,IAAI,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC;YAwD/C;;;;;eAKG;sCA9DA,MAAM,OACN,IAAI,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC;YAmE/C;;;;;eAKG;kCAFQ,MAAM;;;EAyBxB;mCAhGU,MAAM,OACN,IAAI,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC;oCAiFzC,UAAU,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC;iCAC3D,qBAAqB,CAAC,oBAAoB,CAAC;+BAlPjB,oBAAoB;gCAApB,oBAAoB;uCACxB,YAAY;AA4JhD;;;;;GAKG;AAEH;;;;;;;;;;;;;;GAcG;AACH,oDAHW,OAAO,mBAAmB,EAAE,IAAI,2BAChC,UAAU,CAAC,OAAO,0BAA0B,CAAC;;QAgBhD;;WAEG;8BADQ,OAAO,iBAAiB,EAAE,cAAc;;;;YAvJnD,qCAAqC;+BAAzB,iBAAiB;;;;QAiK7B;;;;;;WAMG;4BAnDA,MAAM,OACN,IAAI,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC;QAwD/C;;;;;WAKG;kCA9DA,MAAM,OACN,IAAI,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC;QAmE/C;;;;;WAKG;8BAFQ,MAAM;;GAUtB;AAtOH;;;GAGG;AACH,kDAHW,OAAO,mBAAmB,EAAE,IAAI,YAChC,OAAO,aAAa,EAAE,QAAQ;IA+BjC,qCAAqC;uBAAzB,iBAAiB;GA4FpC"}
|
package/src/transfer.js
CHANGED
|
@@ -8,6 +8,7 @@ import { TargetAppI, AppTransformerI } from './bridge-target.js';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @import {TargetApp, TargetHost} from './bridge-target.js'
|
|
11
|
+
* @import {VTransferIBCEvent} from './types.js';
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -49,6 +50,7 @@ const prepareTransferInterceptor = (zone, vowTools) => {
|
|
|
49
50
|
}),
|
|
50
51
|
{
|
|
51
52
|
public: {
|
|
53
|
+
/** @param {VTransferIBCEvent} obj */
|
|
52
54
|
async receiveUpcall(obj) {
|
|
53
55
|
const { isActiveTap, tap } = this.state;
|
|
54
56
|
|
package/src/types.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { FungibleTokenPacketData } from '@agoric/cosmic-proto/ibc/applications/transfer/v2/packet.js';
|
|
1
2
|
import type { BridgeIdValue, Remote } from '@agoric/internal';
|
|
2
3
|
import type { Bytes } from '@agoric/network';
|
|
3
4
|
import type { Guarded } from '@endo/exo';
|
|
5
|
+
import type { LocalChainAccount } from './localchain.js';
|
|
6
|
+
import type { TargetApp } from './bridge-target.js';
|
|
4
7
|
|
|
5
8
|
export type Board = ReturnType<
|
|
6
9
|
ReturnType<typeof import('./lib-board.js').prepareBoardKit>
|
|
@@ -264,3 +267,29 @@ type SendPacketDownCall = {
|
|
|
264
267
|
packet: IBCPacket;
|
|
265
268
|
relativeTimeoutNs: bigint;
|
|
266
269
|
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* This event is emitted when a FungibleTokenPacket is sent or received
|
|
273
|
+
* by a target (e.g. a {@link LocalChainAccount}) that has a registered
|
|
274
|
+
* {@link TargetApp}. It is passed through the `receiveUpcall` handler.
|
|
275
|
+
*/
|
|
276
|
+
export type VTransferIBCEvent = {
|
|
277
|
+
type: 'VTRANSFER_IBC_EVENT';
|
|
278
|
+
blockHeight: number;
|
|
279
|
+
blockTime: number;
|
|
280
|
+
/**
|
|
281
|
+
* Indicates the type of IBC packet event:
|
|
282
|
+
* - 'acknowledgementPacket': passive tap that communicates the result of an acknowledged packet
|
|
283
|
+
* - 'writeAcknowledgement': active tap where the receiver can return a write acknowledgement
|
|
284
|
+
*/
|
|
285
|
+
event: 'acknowledgementPacket' | 'writeAcknowledgement';
|
|
286
|
+
acknowledgement: Bytes;
|
|
287
|
+
/**
|
|
288
|
+
* Use `JSON.parse(atob(packet.data))` to get a
|
|
289
|
+
* {@link FungibleTokenPacketData} object.
|
|
290
|
+
*/
|
|
291
|
+
packet: IBCPacket;
|
|
292
|
+
relayer: string;
|
|
293
|
+
/** e.g. the chain address of the LocalChainAccount */
|
|
294
|
+
target: string;
|
|
295
|
+
};
|
package/src/vat-transfer.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
28
28
|
};
|
|
29
29
|
interceptorFactory: {
|
|
30
30
|
wrapApp: (tap: globalThis.ERef<import("./bridge-target.js").TargetApp>, targetHost: globalThis.ERef<import("./bridge-target.js").TargetHost>, isActiveTap?: boolean | undefined) => import("@endo/exo").Guarded<{
|
|
31
|
-
receiveUpcall(obj:
|
|
31
|
+
receiveUpcall(obj: import("./types").VTransferIBCEvent): Promise<import("@agoric/vow").Vow<unknown> | undefined>;
|
|
32
32
|
}>;
|
|
33
33
|
};
|
|
34
34
|
transferMiddleware: {
|
|
@@ -67,7 +67,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
67
67
|
};
|
|
68
68
|
interceptorFactory: {
|
|
69
69
|
wrapApp: (tap: globalThis.ERef<import("./bridge-target.js").TargetApp>, targetHost: globalThis.ERef<import("./bridge-target.js").TargetHost>, isActiveTap?: boolean | undefined) => import("@endo/exo").Guarded<{
|
|
70
|
-
receiveUpcall(obj:
|
|
70
|
+
receiveUpcall(obj: import("./types").VTransferIBCEvent): Promise<import("@agoric/vow").Vow<unknown> | undefined>;
|
|
71
71
|
}>;
|
|
72
72
|
};
|
|
73
73
|
transferMiddleware: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-transfer.d.ts","sourceRoot":"","sources":["vat-transfer.js"],"names":[],"mappings":"AASO;IAyBH;;;;;OAKG;2BAJqD,CAAC,SAA5C,OAAQ,kBAAkB,EAAE,aAAc,WAC5C,OAAO,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;;;;;;;;;;;;;IAkBnD;;;OAGG;;;
|
|
1
|
+
{"version":3,"file":"vat-transfer.d.ts","sourceRoot":"","sources":["vat-transfer.js"],"names":[],"mappings":"AASO;IAyBH;;;;;OAKG;2BAJqD,CAAC,SAA5C,OAAQ,kBAAkB,EAAE,aAAc,WAC5C,OAAO,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;;;;;;;;;;;;;IAkBnD;;;OAGG;;;yCAM6iK,oBAAiB;;;;;;;;yDAAl6C,oBAAoB;+DAApB,oBAAoB;;;;;IA7BnrH;;;;;OAKG;2BAJqD,CAAC,SAA5C,OAAQ,kBAAkB,EAAE,aAAc,WAC5C,OAAO,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;;;;;;;;;;;;;IAkBnD;;;OAGG;;;;;;;;;;;;;;;;GAGN;0BAEa,UAAU,CAAC,OAAO,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-bridge.d.ts","sourceRoot":"","sources":["fake-bridge.js"],"names":[],"mappings":"AAiBA,6EAA6E;AAE7E,sCAAuC;AAchC,yCANI,OAAO,cAAc,EAAE,IAAI,SAEnC;IAAuB,QAAQ,EAAvB,QAAQ;CAChB,GAAU,oBAAoB,MAAM,CAAC,CA0FvC;AAOM,wCAJI,OAAO,cAAc,EAAE,IAAI,cAC3B,CAAC,GAAG,KAAA,KAAK,IAAI,GACX,oBAAoB,MAAM,CAAC,CA8BvC;AAED,iEAAkE;AAO3D,+CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"fake-bridge.d.ts","sourceRoot":"","sources":["fake-bridge.js"],"names":[],"mappings":"AAiBA,6EAA6E;AAE7E,sCAAuC;AAchC,yCANI,OAAO,cAAc,EAAE,IAAI,SAEnC;IAAuB,QAAQ,EAAvB,QAAQ;CAChB,GAAU,oBAAoB,MAAM,CAAC,CA0FvC;AAOM,wCAJI,OAAO,cAAc,EAAE,IAAI,cAC3B,CAAC,GAAG,KAAA,KAAK,IAAI,GACX,oBAAoB,MAAM,CAAC,CA8BvC;AAED,iEAAkE;AAO3D,+CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,aAAa,CAAC,CAwE9C;AAOM,6CAJI,OAAO,cAAc,EAAE,IAAI,8BAClB,IAAI,gBACX,oBAAoB,WAAW,CAAC,CAuC5C;uBArQa;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAAE;yCAPX,iBAAiB"}
|
package/tools/fake-bridge.js
CHANGED
|
@@ -166,6 +166,7 @@ export const makeFakeLocalchainBridge = (zone, onToBridge = () => {}) => {
|
|
|
166
166
|
/** @type {Remote<BridgeHandler>} */
|
|
167
167
|
let hndlr;
|
|
168
168
|
let lcaExecuteTxSequence = 0;
|
|
169
|
+
let accountsCreated = 0;
|
|
169
170
|
return zone.exo('Fake Localchain Bridge Manager', undefined, {
|
|
170
171
|
getBridgeId: () => 'vlocalchain',
|
|
171
172
|
toBridge: async obj => {
|
|
@@ -173,8 +174,11 @@ export const makeFakeLocalchainBridge = (zone, onToBridge = () => {}) => {
|
|
|
173
174
|
const { method, type, ...params } = obj;
|
|
174
175
|
trace('toBridge', type, method, params);
|
|
175
176
|
switch (type) {
|
|
176
|
-
case 'VLOCALCHAIN_ALLOCATE_ADDRESS':
|
|
177
|
-
|
|
177
|
+
case 'VLOCALCHAIN_ALLOCATE_ADDRESS': {
|
|
178
|
+
const address = `${LOCALCHAIN_DEFAULT_ADDRESS}${accountsCreated || ''}`;
|
|
179
|
+
accountsCreated += 1;
|
|
180
|
+
return address;
|
|
181
|
+
}
|
|
178
182
|
case 'VLOCALCHAIN_EXECUTE_TX': {
|
|
179
183
|
lcaExecuteTxSequence += 1;
|
|
180
184
|
return obj.messages.map(message => {
|