@agoric/vats 0.15.2-dev-857e650.0 → 0.15.2-dev-284e2db.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 +20 -20
- package/src/bridge.d.ts.map +1 -1
- package/src/bridge.js +23 -11
- package/src/centralSupply.d.ts.map +1 -1
- package/src/centralSupply.js +3 -3
- package/src/core/basic-behaviors.d.ts.map +1 -1
- package/src/core/basic-behaviors.js +55 -49
- package/src/core/boot-chain.js +3 -3
- package/src/core/boot-sim.js +3 -3
- package/src/core/boot-solo.js +4 -4
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +28 -23
- package/src/core/client-behaviors.d.ts.map +1 -1
- package/src/core/client-behaviors.js +5 -4
- package/src/core/demoIssuers.d.ts +17 -15
- package/src/core/demoIssuers.d.ts.map +1 -1
- package/src/core/demoIssuers.js +34 -34
- package/src/core/lib-boot.d.ts +9 -8
- package/src/core/lib-boot.d.ts.map +1 -1
- package/src/core/lib-boot.js +26 -15
- package/src/core/promise-space.d.ts.map +1 -1
- package/src/core/promise-space.js +14 -14
- package/src/core/startWalletFactory.d.ts +4 -1
- package/src/core/startWalletFactory.d.ts.map +1 -1
- package/src/core/startWalletFactory.js +25 -16
- package/src/core/types.d.ts +19 -278
- package/src/core/types.d.ts.map +1 -1
- package/src/core/types.js +385 -210
- package/src/core/utils.d.ts +4 -2
- package/src/core/utils.d.ts.map +1 -1
- package/src/core/utils.js +30 -28
- package/src/crc.d.ts +2 -6
- package/src/crc.d.ts.map +1 -1
- package/src/crc.js +5 -15
- package/src/ibc.d.ts +5 -5
- package/src/ibc.d.ts.map +1 -1
- package/src/ibc.js +22 -40
- package/src/lib-board.d.ts +48 -49
- package/src/lib-board.d.ts.map +1 -1
- package/src/lib-board.js +32 -39
- package/src/mintHolder.d.ts.map +1 -1
- package/src/mintHolder.js +5 -6
- package/src/nameHub.d.ts.map +1 -1
- package/src/nameHub.js +17 -7
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/network-proposal.js +13 -10
- package/src/proposals/restart-vats-proposal.d.ts +1 -1
- package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
- package/src/proposals/restart-vats-proposal.js +3 -3
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +9 -10
- package/src/provisionPoolKit.d.ts +14 -27
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +26 -29
- package/src/repl.js +1 -1
- package/src/types.d.ts +28 -27
- package/src/types.d.ts.map +1 -1
- package/src/types.js +49 -46
- package/src/vat-bank.d.ts +49 -48
- package/src/vat-bank.d.ts.map +1 -1
- package/src/vat-bank.js +55 -50
- package/src/vat-mints.d.ts +10 -10
- package/src/vat-mints.d.ts.map +1 -1
- package/src/vat-mints.js +6 -6
- package/src/vat-provisioning.d.ts.map +1 -1
- package/src/vat-provisioning.js +11 -6
- package/src/virtual-purse.d.ts +6 -6
- package/src/virtual-purse.d.ts.map +1 -1
- package/src/virtual-purse.js +34 -33
- package/src/walletFlags.js +1 -2
- package/tools/authorityViz.d.ts.map +1 -1
- package/tools/authorityViz.js +34 -25
- package/tools/bank-utils.d.ts +1 -1
- package/tools/bank-utils.d.ts.map +1 -1
- package/tools/bank-utils.js +12 -5
- package/tools/board-utils.d.ts +1 -1
- package/tools/board-utils.d.ts.map +1 -1
- package/tools/board-utils.js +22 -14
- package/tools/boot-test-utils.d.ts.map +1 -1
- package/tools/boot-test-utils.js +7 -9
package/src/types.d.ts
CHANGED
|
@@ -3,31 +3,30 @@ export type Board = ReturnType<ReturnType<typeof import('./lib-board.js').prepar
|
|
|
3
3
|
/**
|
|
4
4
|
* read-only access to a node in a name hierarchy
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* trips for the contents of even the simplest nameHub.
|
|
6
|
+
* NOTE: We need to return arrays, not iterables, because even if marshal could
|
|
7
|
+
* allow passing a remote iterable, there would be an inordinate number of
|
|
8
|
+
* round trips for the contents of even the simplest nameHub.
|
|
9
9
|
*/
|
|
10
10
|
export type NameHub = {
|
|
11
11
|
has: (key: string) => boolean;
|
|
12
12
|
/**
|
|
13
|
-
* Look up a
|
|
14
|
-
*
|
|
15
|
-
* promises.
|
|
13
|
+
* Look up a path of keys
|
|
14
|
+
* starting from the current NameHub. Wait on any reserved promises.
|
|
16
15
|
*/
|
|
17
|
-
lookup: (...path:
|
|
16
|
+
lookup: (...path: string[]) => Promise<any>;
|
|
18
17
|
/**
|
|
19
|
-
* get
|
|
20
|
-
* available in the current NameHub
|
|
18
|
+
* get
|
|
19
|
+
* all the entries available in the current NameHub
|
|
21
20
|
*/
|
|
22
21
|
entries: (includeReserved?: boolean) => [string, unknown][];
|
|
23
22
|
/**
|
|
24
|
-
* get all names available in the
|
|
25
|
-
*
|
|
23
|
+
* get all names available in the current
|
|
24
|
+
* NameHub
|
|
26
25
|
*/
|
|
27
26
|
keys: () => string[];
|
|
28
27
|
/**
|
|
29
|
-
* get all values available in the
|
|
30
|
-
*
|
|
28
|
+
* get all values available in the current
|
|
29
|
+
* NameHub
|
|
31
30
|
*/
|
|
32
31
|
values: () => unknown[];
|
|
33
32
|
};
|
|
@@ -37,32 +36,32 @@ export type NameHub = {
|
|
|
37
36
|
export type NameAdmin = {
|
|
38
37
|
provideChild: (key: string, reserved?: string[]) => Promise<NameHubKit>;
|
|
39
38
|
/**
|
|
40
|
-
* Mark a key as reserved;
|
|
41
|
-
* return a promise that is fulfilled when the key is updated (or
|
|
42
|
-
* deleted). If the key was already set it does nothing.
|
|
39
|
+
* Mark a key as reserved;
|
|
40
|
+
* will return a promise that is fulfilled when the key is updated (or
|
|
41
|
+
* rejected when deleted). If the key was already set it does nothing.
|
|
43
42
|
*/
|
|
44
43
|
reserve: (key: string) => Promise<void>;
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* Update if not already updated. Return existing value, or newValue if not
|
|
46
|
+
* existing.
|
|
48
47
|
*/
|
|
49
48
|
default: <T>(key: string, newValue: T, newAdmin?: NameAdmin) => T;
|
|
50
49
|
/**
|
|
51
|
-
*
|
|
50
|
+
* Update only if already initialized. Reject if not.
|
|
52
51
|
*/
|
|
53
52
|
set: (key: string, newValue: unknown, newAdmin?: NameAdmin) => void;
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
54
|
+
* Fulfill an outstanding reserved promise (if any) to the newValue and set the
|
|
55
|
+
* key to the newValue. If newAdmin is provided, set that to return via
|
|
56
|
+
* lookupAdmin.
|
|
58
57
|
*/
|
|
59
58
|
update: (key: string, newValue: unknown, newAdmin?: NameAdmin) => void;
|
|
60
59
|
/**
|
|
61
60
|
* Look up the
|
|
62
|
-
* `newAdmin` from the path of keys starting from the current NameAdmin.
|
|
61
|
+
* `newAdmin` from the path of keys starting from the current NameAdmin. Wait
|
|
63
62
|
* on any reserved promises.
|
|
64
63
|
*/
|
|
65
|
-
lookupAdmin: (...path:
|
|
64
|
+
lookupAdmin: (...path: string[]) => Promise<NameAdmin>;
|
|
66
65
|
/**
|
|
67
66
|
* Delete a value and reject an
|
|
68
67
|
* outstanding reserved promise (if any).
|
|
@@ -73,7 +72,7 @@ export type NameAdmin = {
|
|
|
73
72
|
* current NameAdmin
|
|
74
73
|
*/
|
|
75
74
|
readonly: () => NameHub;
|
|
76
|
-
onUpdate: (fn: undefined |
|
|
75
|
+
onUpdate: (fn: undefined | NameHubUpdateHandler) => void;
|
|
77
76
|
};
|
|
78
77
|
export type NameHubUpdateHandler = {
|
|
79
78
|
write: (entries: [string, unknown][]) => void;
|
|
@@ -102,7 +101,8 @@ export type NamesByAddressAdmin = NameAdmin & {
|
|
|
102
101
|
lookupAdmin(addr: string): Promise<MyAddressNameAdmin>;
|
|
103
102
|
};
|
|
104
103
|
/**
|
|
105
|
-
* An object that can receive messages from the
|
|
104
|
+
* An object that can receive messages from the
|
|
105
|
+
* bridge device
|
|
106
106
|
*/
|
|
107
107
|
export type BridgeHandler = {
|
|
108
108
|
/**
|
|
@@ -111,7 +111,8 @@ export type BridgeHandler = {
|
|
|
111
111
|
fromBridge: (obj: any) => Promise<void>;
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
|
-
* An object which handles messages for a
|
|
114
|
+
* An object which handles messages for a
|
|
115
|
+
* specific bridge
|
|
115
116
|
*/
|
|
116
117
|
export type ScopedBridgeManager = {
|
|
117
118
|
toBridge: (obj: any) => Promise<any>;
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"uBAMa,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;oBAI5B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"uBAMa,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;oBAI5B,WACZ,WAAe,cAAc,gBAAgB,EAAE,eAAe,CAAC,CAC5D,CAAC,OAAO,CAAC;;;;;;;;;eASO,MAAM,KAAK,OAAO;;;;;sBACd,MAAM,EAAE,KAAK,QAAQ,GAAG,CAAC;;;;;gCAEhB,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;UAElD,MAAM,MAAM,EAAE;;;;;YAEd,MAAM,OAAO,EAAE;;;;;;wBAMT,MAAM,aAAa,MAAM,EAAE,KAAK,QAAQ,UAAU,CAAC;;;;;;mBACnD,MAAM,KAAK,QAAQ,IAAI,CAAC;;;;;sBAGrB,MAAM,0BAA0B,SAAS;;;;eAG5C,MAAM,YAAY,OAAO,aAAa,SAAS,KAAK,IAAI;;;;;;kBAExD,MAAM,YAAY,OAAO,aAAa,SAAS,KAAK,IAAI;;;;;;2BAIpD,MAAM,EAAE,KAAK,QAAQ,SAAS,CAAC;;;;;kBAGnC,MAAM,KAAK,IAAI;;;;;cAErB,MAAM,OAAO;mBAER,SAAS,GAAG,oBAAoB,KAAK,IAAI;;;qBAE5B,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI;;;;;;;;;aAK9C,OAAO;;;;eACP,SAAS;;iCAGT,SAAS,GAAG;IAAE,YAAY,IAAI,MAAM,CAAA;CAAE;;uBAIvC,MAAM,aACD,MAAM,EAAE,GAClB,QAAQ;QACf,OAAa,EAAE,OAAO,CAAC;QACvB,SAAe,EAAE,kBAAkB,CAAC;KAC/B,CAAC;sBACgB,MAAM,GAAG,QAAQ,kBAAkB,CAAC;;;;;;;;;;sBAOvC,GAAG,KAAK,QAAQ,IAAI,CAAC;;;;;;;oBAMrB,GAAG,KAAK,QAAQ,GAAG,CAAC;sBACpB,GAAG,KAAK,QAAQ,IAAI,CAAC;2BACjB,KAAK,aAAa,CAAC,KAAK,IAAI;0BAC5B,KAAK,aAAa,CAAC,KAAK,IAAI;;;;;;yBAMrC,MAAM,YACN,KAAK,aAAa,GAAG,SAAS,CAAC,KACtC,mBAAmB"}
|
package/src/types.js
CHANGED
|
@@ -8,54 +8,51 @@ export {};
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @typedef {ReturnType<
|
|
11
|
+
* @typedef {ReturnType<
|
|
12
|
+
* ReturnType<typeof import('./lib-board.js').prepareBoardKit>
|
|
13
|
+
* >['board']} Board
|
|
12
14
|
*/
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* @typedef {object} NameHub read-only access to a node in a name hierarchy
|
|
16
18
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* trips for the contents of even the simplest nameHub.
|
|
20
|
-
*
|
|
19
|
+
* NOTE: We need to return arrays, not iterables, because even if marshal could
|
|
20
|
+
* allow passing a remote iterable, there would be an inordinate number of
|
|
21
|
+
* round trips for the contents of even the simplest nameHub.
|
|
21
22
|
* @property {(key: string) => boolean} has
|
|
22
|
-
* @property {(...path:
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* available in the current
|
|
27
|
-
*
|
|
28
|
-
* current
|
|
29
|
-
*
|
|
30
|
-
* current NameHub
|
|
23
|
+
* @property {(...path: string[]) => Promise<any>} lookup Look up a path of keys
|
|
24
|
+
* starting from the current NameHub. Wait on any reserved promises.
|
|
25
|
+
* @property {(includeReserved?: boolean) => [string, unknown][]} entries get
|
|
26
|
+
* all the entries available in the current NameHub
|
|
27
|
+
* @property {() => string[]} keys get all names available in the current
|
|
28
|
+
* NameHub
|
|
29
|
+
* @property {() => unknown[]} values get all values available in the current
|
|
30
|
+
* NameHub
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @typedef {object} NameAdmin write access to a node in a name hierarchy
|
|
35
|
-
*
|
|
36
35
|
* @property {(key: string, reserved?: string[]) => Promise<NameHubKit>} provideChild
|
|
37
|
-
* @property {(key: string) => Promise<void>} reserve Mark a key as reserved;
|
|
38
|
-
* return a promise that is fulfilled when the key is updated (or
|
|
39
|
-
* deleted). If the key was already set it does nothing.
|
|
40
|
-
* @property {<T>(
|
|
41
|
-
*
|
|
42
|
-
* existing
|
|
43
|
-
* @property {(
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* key
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `newAdmin` from the path of keys starting from the current NameAdmin. Wait
|
|
53
|
-
* on any reserved promises.
|
|
36
|
+
* @property {(key: string) => Promise<void>} reserve Mark a key as reserved;
|
|
37
|
+
* will return a promise that is fulfilled when the key is updated (or
|
|
38
|
+
* rejected when deleted). If the key was already set it does nothing.
|
|
39
|
+
* @property {<T>(key: string, newValue: T, newAdmin?: NameAdmin) => T} default
|
|
40
|
+
* Update if not already updated. Return existing value, or newValue if not
|
|
41
|
+
* existing.
|
|
42
|
+
* @property {(key: string, newValue: unknown, newAdmin?: NameAdmin) => void} set
|
|
43
|
+
* Update only if already initialized. Reject if not.
|
|
44
|
+
* @property {(key: string, newValue: unknown, newAdmin?: NameAdmin) => void} update
|
|
45
|
+
* Fulfill an outstanding reserved promise (if any) to the newValue and set the
|
|
46
|
+
* key to the newValue. If newAdmin is provided, set that to return via
|
|
47
|
+
* lookupAdmin.
|
|
48
|
+
* @property {(...path: string[]) => Promise<NameAdmin>} lookupAdmin Look up the
|
|
49
|
+
* `newAdmin` from the path of keys starting from the current NameAdmin. Wait
|
|
50
|
+
* on any reserved promises.
|
|
54
51
|
* @property {(key: string) => void} delete Delete a value and reject an
|
|
55
|
-
*
|
|
52
|
+
* outstanding reserved promise (if any).
|
|
56
53
|
* @property {() => NameHub} readonly get the NameHub corresponding to the
|
|
57
|
-
*
|
|
58
|
-
* @property {(fn: undefined |
|
|
54
|
+
* current NameAdmin
|
|
55
|
+
* @property {(fn: undefined | NameHubUpdateHandler) => void} onUpdate
|
|
59
56
|
*
|
|
60
57
|
* @typedef {{ write: (entries: [string, unknown][]) => void }} NameHubUpdateHandler
|
|
61
58
|
*/
|
|
@@ -66,26 +63,29 @@ export {};
|
|
|
66
63
|
* @property {NameAdmin} nameAdmin write access
|
|
67
64
|
*/
|
|
68
65
|
|
|
69
|
-
/**
|
|
70
|
-
* @typedef {NameAdmin & { getMyAddress(): string }} MyAddressNameAdmin
|
|
71
|
-
*/
|
|
66
|
+
/** @typedef {NameAdmin & { getMyAddress(): string }} MyAddressNameAdmin */
|
|
72
67
|
/**
|
|
73
68
|
* @typedef {NameAdmin & {
|
|
74
|
-
* provideChild(
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
69
|
+
* provideChild(
|
|
70
|
+
* addr: string,
|
|
71
|
+
* reserved?: string[],
|
|
72
|
+
* ): Promise<{
|
|
73
|
+
* nameHub: NameHub;
|
|
74
|
+
* nameAdmin: MyAddressNameAdmin;
|
|
75
|
+
* }>;
|
|
76
|
+
* lookupAdmin(addr: string): Promise<MyAddressNameAdmin>;
|
|
79
77
|
* }} NamesByAddressAdmin
|
|
80
78
|
*/
|
|
81
79
|
|
|
82
80
|
/**
|
|
83
|
-
* @typedef {object} BridgeHandler An object that can receive messages from the
|
|
81
|
+
* @typedef {object} BridgeHandler An object that can receive messages from the
|
|
82
|
+
* bridge device
|
|
84
83
|
* @property {(obj: any) => Promise<void>} fromBridge Handle an inbound message
|
|
85
84
|
*/
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
|
-
* @typedef {object} ScopedBridgeManager An object which handles messages for a
|
|
87
|
+
* @typedef {object} ScopedBridgeManager An object which handles messages for a
|
|
88
|
+
* specific bridge
|
|
89
89
|
* @property {(obj: any) => Promise<any>} toBridge
|
|
90
90
|
* @property {(obj: any) => Promise<void>} fromBridge
|
|
91
91
|
* @property {(handler: ERef<BridgeHandler>) => void} initHandler
|
|
@@ -94,5 +94,8 @@ export {};
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* @typedef {object} BridgeManager The object to manage this bridge
|
|
97
|
-
* @property {(
|
|
97
|
+
* @property {(
|
|
98
|
+
* bridgeId: string,
|
|
99
|
+
* handler?: ERef<BridgeHandler | undefined>,
|
|
100
|
+
* ) => ScopedBridgeManager} register
|
|
98
101
|
*/
|
package/src/vat-bank.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
2
2
|
/**
|
|
3
|
-
* @param {ERef<import('./types.js').ScopedBridgeManager | undefined>} [bankBridgeManagerP]
|
|
4
|
-
* manager for the "remote" bank (such as on cosmos-sdk).
|
|
5
|
-
* (such as on sim-chain), we just use local purses.
|
|
6
|
-
* @param {ERef<{ update: import('./types.js').NameAdmin['update'] }>} [nameAdminP]
|
|
7
|
-
* a NameAdmin; see addAsset() for detail.
|
|
3
|
+
* @param {ERef<import('./types.js').ScopedBridgeManager | undefined>} [bankBridgeManagerP]
|
|
4
|
+
* a bridge manager for the "remote" bank (such as on cosmos-sdk). If not
|
|
5
|
+
* supplied (such as on sim-chain), we just use local purses.
|
|
6
|
+
* @param {ERef<{ update: import('./types.js').NameAdmin['update'] }>} [nameAdminP]
|
|
7
|
+
* update facet of a NameAdmin; see addAsset() for detail.
|
|
8
8
|
*/
|
|
9
9
|
makeBankManager(bankBridgeManagerP?: ERef<import('./types.js').ScopedBridgeManager | undefined>, nameAdminP?: ERef<{
|
|
10
10
|
update: import('./types.js').NameAdmin['update'];
|
|
@@ -26,20 +26,21 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
26
26
|
*
|
|
27
27
|
* @param {string} moduleName
|
|
28
28
|
* @returns {Promise<string | null>} address of named module account, or
|
|
29
|
-
*
|
|
29
|
+
* null if unimplemented (no bankChannel)
|
|
30
30
|
*/
|
|
31
31
|
getModuleAccountAddress(moduleName: string): Promise<string | null>;
|
|
32
32
|
/**
|
|
33
|
-
* Add an asset to the bank, and publish it to the subscriptions.
|
|
34
|
-
*
|
|
33
|
+
* Add an asset to the bank, and publish it to the subscriptions. If
|
|
34
|
+
* nameAdmin is defined, update with denom to AssetInfo entry.
|
|
35
35
|
*
|
|
36
|
-
* Note that AssetInfo has the settled identity of the issuer,
|
|
37
|
-
*
|
|
36
|
+
* Note that AssetInfo has the settled identity of the issuer, not just a
|
|
37
|
+
* promise for it.
|
|
38
38
|
*
|
|
39
39
|
* @param {string} denom lower-level denomination string
|
|
40
40
|
* @param {string} issuerName
|
|
41
41
|
* @param {string} proposedName
|
|
42
|
-
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
42
|
+
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
43
|
+
* kit (mint, brand, issuer)
|
|
43
44
|
*/
|
|
44
45
|
addAsset(denom: string, issuerName: string, proposedName: string, kit: AssetIssuerKit<AssetKind> & {
|
|
45
46
|
payment?: ERef<Payment<AssetKind>> | undefined;
|
|
@@ -69,20 +70,21 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
69
70
|
*
|
|
70
71
|
* @param {string} moduleName
|
|
71
72
|
* @returns {Promise<string | null>} address of named module account, or
|
|
72
|
-
*
|
|
73
|
+
* null if unimplemented (no bankChannel)
|
|
73
74
|
*/
|
|
74
75
|
getModuleAccountAddress(moduleName: string): Promise<string | null>;
|
|
75
76
|
/**
|
|
76
|
-
* Add an asset to the bank, and publish it to the subscriptions.
|
|
77
|
-
*
|
|
77
|
+
* Add an asset to the bank, and publish it to the subscriptions. If
|
|
78
|
+
* nameAdmin is defined, update with denom to AssetInfo entry.
|
|
78
79
|
*
|
|
79
|
-
* Note that AssetInfo has the settled identity of the issuer,
|
|
80
|
-
*
|
|
80
|
+
* Note that AssetInfo has the settled identity of the issuer, not just a
|
|
81
|
+
* promise for it.
|
|
81
82
|
*
|
|
82
83
|
* @param {string} denom lower-level denomination string
|
|
83
84
|
* @param {string} issuerName
|
|
84
85
|
* @param {string} proposedName
|
|
85
|
-
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
86
|
+
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
87
|
+
* kit (mint, brand, issuer)
|
|
86
88
|
*/
|
|
87
89
|
addAsset(denom: string, issuerName: string, proposedName: string, kit: AssetIssuerKit<AssetKind> & {
|
|
88
90
|
payment?: ERef<Payment<AssetKind>> | undefined;
|
|
@@ -97,11 +99,11 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
97
99
|
}>>;
|
|
98
100
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
99
101
|
/**
|
|
100
|
-
* @param {ERef<import('./types.js').ScopedBridgeManager | undefined>} [bankBridgeManagerP]
|
|
101
|
-
* manager for the "remote" bank (such as on cosmos-sdk).
|
|
102
|
-
* (such as on sim-chain), we just use local purses.
|
|
103
|
-
* @param {ERef<{ update: import('./types.js').NameAdmin['update'] }>} [nameAdminP]
|
|
104
|
-
* a NameAdmin; see addAsset() for detail.
|
|
102
|
+
* @param {ERef<import('./types.js').ScopedBridgeManager | undefined>} [bankBridgeManagerP]
|
|
103
|
+
* a bridge manager for the "remote" bank (such as on cosmos-sdk). If not
|
|
104
|
+
* supplied (such as on sim-chain), we just use local purses.
|
|
105
|
+
* @param {ERef<{ update: import('./types.js').NameAdmin['update'] }>} [nameAdminP]
|
|
106
|
+
* update facet of a NameAdmin; see addAsset() for detail.
|
|
105
107
|
*/
|
|
106
108
|
makeBankManager(bankBridgeManagerP?: ERef<import('./types.js').ScopedBridgeManager | undefined>, nameAdminP?: ERef<{
|
|
107
109
|
update: import('./types.js').NameAdmin['update'];
|
|
@@ -123,20 +125,21 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
123
125
|
*
|
|
124
126
|
* @param {string} moduleName
|
|
125
127
|
* @returns {Promise<string | null>} address of named module account, or
|
|
126
|
-
*
|
|
128
|
+
* null if unimplemented (no bankChannel)
|
|
127
129
|
*/
|
|
128
130
|
getModuleAccountAddress(moduleName: string): Promise<string | null>;
|
|
129
131
|
/**
|
|
130
|
-
* Add an asset to the bank, and publish it to the subscriptions.
|
|
131
|
-
*
|
|
132
|
+
* Add an asset to the bank, and publish it to the subscriptions. If
|
|
133
|
+
* nameAdmin is defined, update with denom to AssetInfo entry.
|
|
132
134
|
*
|
|
133
|
-
* Note that AssetInfo has the settled identity of the issuer,
|
|
134
|
-
*
|
|
135
|
+
* Note that AssetInfo has the settled identity of the issuer, not just a
|
|
136
|
+
* promise for it.
|
|
135
137
|
*
|
|
136
138
|
* @param {string} denom lower-level denomination string
|
|
137
139
|
* @param {string} issuerName
|
|
138
140
|
* @param {string} proposedName
|
|
139
|
-
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
141
|
+
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
142
|
+
* kit (mint, brand, issuer)
|
|
140
143
|
*/
|
|
141
144
|
addAsset(denom: string, issuerName: string, proposedName: string, kit: AssetIssuerKit<AssetKind> & {
|
|
142
145
|
payment?: ERef<Payment<AssetKind>> | undefined;
|
|
@@ -166,20 +169,21 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
166
169
|
*
|
|
167
170
|
* @param {string} moduleName
|
|
168
171
|
* @returns {Promise<string | null>} address of named module account, or
|
|
169
|
-
*
|
|
172
|
+
* null if unimplemented (no bankChannel)
|
|
170
173
|
*/
|
|
171
174
|
getModuleAccountAddress(moduleName: string): Promise<string | null>;
|
|
172
175
|
/**
|
|
173
|
-
* Add an asset to the bank, and publish it to the subscriptions.
|
|
174
|
-
*
|
|
176
|
+
* Add an asset to the bank, and publish it to the subscriptions. If
|
|
177
|
+
* nameAdmin is defined, update with denom to AssetInfo entry.
|
|
175
178
|
*
|
|
176
|
-
* Note that AssetInfo has the settled identity of the issuer,
|
|
177
|
-
*
|
|
179
|
+
* Note that AssetInfo has the settled identity of the issuer, not just a
|
|
180
|
+
* promise for it.
|
|
178
181
|
*
|
|
179
182
|
* @param {string} denom lower-level denomination string
|
|
180
183
|
* @param {string} issuerName
|
|
181
184
|
* @param {string} proposedName
|
|
182
|
-
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
185
|
+
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
186
|
+
* kit (mint, brand, issuer)
|
|
183
187
|
*/
|
|
184
188
|
addAsset(denom: string, issuerName: string, proposedName: string, kit: AssetIssuerKit<AssetKind> & {
|
|
185
189
|
payment?: ERef<Payment<AssetKind>> | undefined;
|
|
@@ -193,9 +197,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
193
197
|
getBankForAddress(address: string): Promise<Bank>;
|
|
194
198
|
}>>;
|
|
195
199
|
}>;
|
|
196
|
-
/**
|
|
197
|
-
* @typedef {AssetIssuerKit & { denom: string, escrowPurse?: ERef<Purse> }} AssetRecord
|
|
198
|
-
*/
|
|
200
|
+
/** @typedef {AssetIssuerKit & { denom: string; escrowPurse?: ERef<Purse> }} AssetRecord */
|
|
199
201
|
/**
|
|
200
202
|
* @typedef {object} AssetDescriptor
|
|
201
203
|
* @property {Brand} brand
|
|
@@ -205,17 +207,17 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
205
207
|
* @property {string} proposedName
|
|
206
208
|
*/
|
|
207
209
|
/**
|
|
208
|
-
* @typedef {
|
|
209
|
-
* issuer: Issuer<'nat'
|
|
210
|
-
* displayInfo: DisplayInfo
|
|
210
|
+
* @typedef {AssetDescriptor & {
|
|
211
|
+
* issuer: Issuer<'nat'>; // settled identity
|
|
212
|
+
* displayInfo: DisplayInfo;
|
|
211
213
|
* }} AssetInfo
|
|
212
214
|
*/
|
|
213
215
|
/**
|
|
214
216
|
* @typedef {object} Bank
|
|
215
|
-
* @property {() => IterableEachTopic<AssetDescriptor>} getAssetSubscription
|
|
216
|
-
* assets as they are added to the bank
|
|
217
|
-
* @property {(brand: Brand) => Promise<VirtualPurse>} getPurse Find any
|
|
218
|
-
* (keyed by address and brand) or create a new one.
|
|
217
|
+
* @property {() => IterableEachTopic<AssetDescriptor>} getAssetSubscription
|
|
218
|
+
* Returns assets as they are added to the bank
|
|
219
|
+
* @property {(brand: Brand) => Promise<VirtualPurse>} getPurse Find any
|
|
220
|
+
* existing vpurse (keyed by address and brand) or create a new one.
|
|
219
221
|
*/
|
|
220
222
|
export const BankI: import("@endo/patterns").InterfaceGuard<{
|
|
221
223
|
getAssetSubscription: any;
|
|
@@ -249,13 +251,12 @@ export type AssetInfo = AssetDescriptor & {
|
|
|
249
251
|
};
|
|
250
252
|
export type Bank = {
|
|
251
253
|
/**
|
|
252
|
-
*
|
|
253
|
-
* assets as they are added to the bank
|
|
254
|
+
* Returns assets as they are added to the bank
|
|
254
255
|
*/
|
|
255
256
|
getAssetSubscription: () => IterableEachTopic<AssetDescriptor>;
|
|
256
257
|
/**
|
|
257
|
-
* Find any
|
|
258
|
-
* (keyed by address and brand) or create a new one.
|
|
258
|
+
* Find any
|
|
259
|
+
* existing vpurse (keyed by address and brand) or create a new one.
|
|
259
260
|
*/
|
|
260
261
|
getPurse: (brand: Brand) => Promise<VirtualPurse>;
|
|
261
262
|
};
|
package/src/vat-bank.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-bank.d.ts","sourceRoot":"","sources":["vat-bank.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vat-bank.d.ts","sourceRoot":"","sources":["vat-bank.js"],"names":[],"mappings":"AAs0BA;IASI;;;;;;OAMG;yCALQ,KAAK,OAAO,YAAY,EAAE,mBAAmB,GAAG,SAAS,CAAC;gBAG3C,OAAO,YAAY,EAAE,SAAS,CAAC,QAAQ,CAAC;;QAhPhE;;;;WAIG;gCADU,kBAAkB,eAAe,CAAC;QAS/C;;;;WAIG;gDAHQ,MAAM,UACN,cAAc,GACZ,KAAK,OAAO,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAkB1D;;;;;;WAMG;4CAHQ,MAAM,GACJ,QAAQ,MAAM,GAAG,IAAI,CAAC;QAenC;;;;;;;;;;;;WAYG;wBALQ,MAAM,cACN,MAAM,gBACN,MAAM;;;QA4EjB;;;;;WAKG;mCAFQ,MAAM,GACJ,QAAQ,IAAI,CAAC;;QA7I1B;;;;WAIG;gCADU,kBAAkB,eAAe,CAAC;QAS/C;;;;WAIG;gDAHQ,MAAM,UACN,cAAc,GACZ,KAAK,OAAO,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAkB1D;;;;;;WAMG;4CAHQ,MAAM,GACJ,QAAQ,MAAM,GAAG,IAAI,CAAC;QAenC;;;;;;;;;;;;WAYG;wBALQ,MAAM,cACN,MAAM,gBACN,MAAM;;;QA4EjB;;;;;WAKG;mCAFQ,MAAM,GACJ,QAAQ,IAAI,CAAC;;;IA+F5B;;;;;;OAMG;yCALQ,KAAK,OAAO,YAAY,EAAE,mBAAmB,GAAG,SAAS,CAAC;gBAG3C,OAAO,YAAY,EAAE,SAAS,CAAC,QAAQ,CAAC;;QAhPhE;;;;WAIG;gCADU,kBAAkB,eAAe,CAAC;QAS/C;;;;WAIG;gDAHQ,MAAM,UACN,cAAc,GACZ,KAAK,OAAO,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAkB1D;;;;;;WAMG;4CAHQ,MAAM,GACJ,QAAQ,MAAM,GAAG,IAAI,CAAC;QAenC;;;;;;;;;;;;WAYG;wBALQ,MAAM,cACN,MAAM,gBACN,MAAM;;;QA4EjB;;;;;WAKG;mCAFQ,MAAM,GACJ,QAAQ,IAAI,CAAC;;QA7I1B;;;;WAIG;gCADU,kBAAkB,eAAe,CAAC;QAS/C;;;;WAIG;gDAHQ,MAAM,UACN,cAAc,GACZ,KAAK,OAAO,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAkB1D;;;;;;WAMG;4CAHQ,MAAM,GACJ,QAAQ,MAAM,GAAG,IAAI,CAAC;QAenC;;;;;;;;;;;;WAYG;wBALQ,MAAM,cACN,MAAM,gBACN,MAAM;;;QA4EjB;;;;;WAKG;mCAFQ,MAAM,GACJ,QAAQ,IAAI,CAAC;;GA6I/B;AAnhBD,2FAA2F;AAE3F;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;GAGG;qCAtWU,OAAO,iBAAiB,EAAE,sBAAsB;2BAEhD,QAAQ,WAAW,WAAW,0BAA0B,CAAC,CAAC,CAAC;;oBAKlD,MAAM,UAAU,MAAM,KAAK,IAAI;;4BAQxC,KACZ,OAAW,YAAY,EAAE,mBAAmB,EAC5C,YAAgB,GAAG,UAAU,CAC1B;;;YA0SU,KAAK,OAAO,CAAC,CAAC,CAAC;WACf,MAAM,CAAC,CAAC;;0BAYR,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,KAAK,CAAC,CAAA;CAAE;;WAI7D,KAAK;YACL,KAAK,MAAM,CAAC;gBACZ,MAAM;WACN,MAAM;kBACN,MAAM;;wBAIP,eAAe,GAAG;IAC9B,MAAU,EAAE,OAAO,KAAK,CAAC,CAAC;IAC1B,WAAe,EAAE,WAAW,CAAC;CAC1B;;;;;0BAKU,MAAM,kBAAkB,eAAe,CAAC;;;;;sBAEhC,KAAK,KAAK,QAAQ,YAAY,CAAC;;oCA7W9C,oBAAoB"}
|