@agoric/smart-wallet 0.5.4-dev-aa68d8f.0 → 0.5.4-dev-96c9ff5.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 +23 -23
- package/src/invitations.d.ts +1 -1
- package/src/invitations.d.ts.map +1 -1
- package/src/invitations.js +1 -3
- package/src/marshal-contexts.d.ts +39 -35
- package/src/marshal-contexts.d.ts.map +1 -1
- package/src/marshal-contexts.js +28 -24
- package/src/offerWatcher.d.ts +1 -1
- package/src/offers.d.ts +2 -2
- package/src/offers.d.ts.map +1 -1
- package/src/offers.js +1 -1
- package/src/smartWallet.d.ts +2 -2
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +2 -3
- package/src/walletFactory.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/smart-wallet",
|
|
3
|
-
"version": "0.5.4-dev-
|
|
3
|
+
"version": "0.5.4-dev-96c9ff5.0+96c9ff5",
|
|
4
4
|
"description": "Wallet contract",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -16,30 +16,30 @@
|
|
|
16
16
|
"lint:eslint": "eslint ."
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
20
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
21
|
-
"@agoric/zone": "0.2.3-dev-
|
|
22
|
-
"@endo/bundle-source": "^3.2.
|
|
23
|
-
"@endo/captp": "^4.
|
|
24
|
-
"@endo/init": "^1.1.
|
|
19
|
+
"@agoric/cosmic-proto": "0.4.1-dev-96c9ff5.0+96c9ff5",
|
|
20
|
+
"@agoric/swingset-vat": "0.32.3-dev-96c9ff5.0+96c9ff5",
|
|
21
|
+
"@agoric/zone": "0.2.3-dev-96c9ff5.0+96c9ff5",
|
|
22
|
+
"@endo/bundle-source": "^3.2.3",
|
|
23
|
+
"@endo/captp": "^4.2.0",
|
|
24
|
+
"@endo/init": "^1.1.2",
|
|
25
25
|
"ava": "^5.3.0",
|
|
26
26
|
"import-meta-resolve": "^2.2.1"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@agoric/assert": "0.6.1-dev-
|
|
30
|
-
"@agoric/casting": "0.4.3-dev-
|
|
31
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
32
|
-
"@agoric/internal": "0.3.3-dev-
|
|
33
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
34
|
-
"@agoric/store": "0.9.3-dev-
|
|
35
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
36
|
-
"@agoric/vats": "0.15.2-dev-
|
|
37
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
38
|
-
"@endo/eventual-send": "^1.2.
|
|
39
|
-
"@endo/far": "^1.1.
|
|
40
|
-
"@endo/marshal": "^1.
|
|
41
|
-
"@endo/nat": "^5.0.
|
|
42
|
-
"@endo/promise-kit": "^1.1.
|
|
29
|
+
"@agoric/assert": "0.6.1-dev-96c9ff5.0+96c9ff5",
|
|
30
|
+
"@agoric/casting": "0.4.3-dev-96c9ff5.0+96c9ff5",
|
|
31
|
+
"@agoric/ertp": "0.16.3-dev-96c9ff5.0+96c9ff5",
|
|
32
|
+
"@agoric/internal": "0.3.3-dev-96c9ff5.0+96c9ff5",
|
|
33
|
+
"@agoric/notifier": "0.6.3-dev-96c9ff5.0+96c9ff5",
|
|
34
|
+
"@agoric/store": "0.9.3-dev-96c9ff5.0+96c9ff5",
|
|
35
|
+
"@agoric/vat-data": "0.5.3-dev-96c9ff5.0+96c9ff5",
|
|
36
|
+
"@agoric/vats": "0.15.2-dev-96c9ff5.0+96c9ff5",
|
|
37
|
+
"@agoric/zoe": "0.26.3-dev-96c9ff5.0+96c9ff5",
|
|
38
|
+
"@endo/eventual-send": "^1.2.2",
|
|
39
|
+
"@endo/far": "^1.1.2",
|
|
40
|
+
"@endo/marshal": "^1.5.0",
|
|
41
|
+
"@endo/nat": "^5.0.7",
|
|
42
|
+
"@endo/promise-kit": "^1.1.2"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"src/"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
70
|
"typeCoverage": {
|
|
71
|
-
"atLeast":
|
|
71
|
+
"atLeast": 94.36
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "96c9ff577fe14cebeb5a38543ba7f8598ffcd0c7"
|
|
74
74
|
}
|
package/src/invitations.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<import("@agoric/vats").NameHub>, invitationBrand: Brand<"set">, invitationsPurse: Purse<"set">, getInvitationContinuation: (fromOfferId: string) => import("./types.js").InvitationMakers): (spec: InvitationSpec) => ERef<Invitation>;
|
|
1
|
+
export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<import("@agoric/vats").NameHub>, invitationBrand: Brand<"set">, invitationsPurse: Purse<"set", InvitationDetails>, getInvitationContinuation: (fromOfferId: string) => import("./types.js").InvitationMakers): (spec: InvitationSpec) => ERef<Invitation>;
|
|
2
2
|
/**
|
|
3
3
|
* Specify how to produce an invitation. See each type in the union for details.
|
|
4
4
|
*/
|
package/src/invitations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAkEO,2CANI,IAAI,CAAC,UAAU,CAAC,eAChB,IAAI,CAAC,OAAO,cAAc,EAAE,OAAO,CAAC,mBACpC,KAAK,CAAC,KAAK,CAAC,oBACZ,KAAK,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAkEO,2CANI,IAAI,CAAC,UAAU,CAAC,eAChB,IAAI,CAAC,OAAO,cAAc,EAAE,OAAO,CAAC,mBACpC,KAAK,CAAC,KAAK,CAAC,oBACZ,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,6BAC/B,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,YAAY,EAAE,gBAAgB,UAoFrD,cAAc,KAAK,IAAI,CAAC,UAAU,CAAC,CAgBtD;;;;6BArJY,4BAA4B,GAAG,sBAAsB,GAAG,mBAAmB,GAAG,wBAAwB;;;;;;;2CAKtG;IACZ,MAAQ,EAAE,gBAAgB,CAAC;IAC3B,YAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAU,EAAE,KAAK,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;CACzD;;;;qCAMS;IACZ,MAAQ,EAAE,UAAU,CAAC;IACrB,QAAU,EAAE,QAAQ,CAAC;IACrB,qBAAuB,EAAE,MAAM,CAAC;IAChC,cAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;CACtB;;;;;kCAGS;IACZ,MAAQ,EAAE,OAAO,CAAC;IAClB,QAAU,EAAE,QAAQ,CAAC;IACrB,WAAa,EAAE,MAAM,CAAC;CACnB;;;;uCAIS;IACZ,MAAQ,EAAE,YAAY,CAAC;IACvB,aAAe,EAAE,OAAO,aAAa,EAAE,OAAO,CAAC;IAC/C,mBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;CACtB;oCAKS,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC"}
|
package/src/invitations.js
CHANGED
|
@@ -61,7 +61,7 @@ const MAX_PIPE_LENGTH = 2;
|
|
|
61
61
|
* @param {ERef<ZoeService>} zoe
|
|
62
62
|
* @param {ERef<import('@agoric/vats').NameHub>} agoricNames
|
|
63
63
|
* @param {Brand<'set'>} invitationBrand
|
|
64
|
-
* @param {Purse<'set'>} invitationsPurse
|
|
64
|
+
* @param {Purse<'set', InvitationDetails>} invitationsPurse
|
|
65
65
|
* @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation
|
|
66
66
|
*/
|
|
67
67
|
export const makeInvitationsHelper = (
|
|
@@ -103,9 +103,7 @@ export const makeInvitationsHelper = (
|
|
|
103
103
|
mustMatch(spec, shape.PurseInvitationSpec);
|
|
104
104
|
|
|
105
105
|
const { instance, description } = spec;
|
|
106
|
-
// @ts-expect-error TS thinks it's always true. I'm doubtful.
|
|
107
106
|
(instance && description) || Fail`missing instance or description`;
|
|
108
|
-
/** @type {Amount<'set'>} */
|
|
109
107
|
const purseAmount = await E(invitationsPurse).getCurrentAmount();
|
|
110
108
|
const invitations = AmountMath.getValue(invitationBrand, purseAmount);
|
|
111
109
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export function makeExportContext(): {
|
|
2
|
-
toCapData: import("
|
|
3
|
-
fromCapData: import("
|
|
4
|
-
serialize: import("
|
|
5
|
-
unserialize: import("
|
|
2
|
+
toCapData: import("@endo/marshal").ToCapData<string>;
|
|
3
|
+
fromCapData: import("@endo/marshal").FromCapData<string>;
|
|
4
|
+
serialize: import("@endo/marshal").ToCapData<string>;
|
|
5
|
+
unserialize: import("@endo/marshal").FromCapData<string>;
|
|
6
6
|
savePurseActions: (val: globalThis.Purse) => void;
|
|
7
7
|
savePaymentActions: (val: globalThis.Payment) => void;
|
|
8
8
|
/**
|
|
@@ -10,55 +10,56 @@ export function makeExportContext(): {
|
|
|
10
10
|
* @param {Purse} purse
|
|
11
11
|
*/
|
|
12
12
|
initPurseId: (id: number, purse: Purse) => void;
|
|
13
|
-
purseEntries: (keyPatt?:
|
|
13
|
+
purseEntries: (keyPatt?: globalThis.Pattern, valuePatt?: globalThis.Pattern) => Iterable<[number, globalThis.Purse]>;
|
|
14
14
|
/**
|
|
15
15
|
* @param {BoardId} id
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {PassableCap} val
|
|
17
17
|
*/
|
|
18
|
-
initBoardId: (id: string, val:
|
|
18
|
+
initBoardId: (id: string, val: PassableCap) => void;
|
|
19
19
|
/**
|
|
20
20
|
* @param {BoardId} id
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {PassableCap} val
|
|
22
22
|
*/
|
|
23
|
-
ensureBoardId: (id: string, val:
|
|
23
|
+
ensureBoardId: (id: string, val: PassableCap) => void;
|
|
24
24
|
};
|
|
25
|
-
export function makeImportContext(makePresence?: ((iface: string) =>
|
|
25
|
+
export function makeImportContext(makePresence?: ((iface: string) => PassableCap) | undefined): {
|
|
26
26
|
/**
|
|
27
27
|
* @param {BoardId} id
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {PassableCap} val
|
|
29
29
|
*/
|
|
30
|
-
initBoardId: (id: string, val:
|
|
30
|
+
initBoardId: (id: string, val: PassableCap) => void;
|
|
31
31
|
/**
|
|
32
32
|
* @param {BoardId} id
|
|
33
|
-
* @param {
|
|
33
|
+
* @param {PassableCap} val
|
|
34
34
|
*/
|
|
35
|
-
ensureBoardId: (id: string, val:
|
|
35
|
+
ensureBoardId: (id: string, val: PassableCap) => void;
|
|
36
36
|
fromMyWallet: {
|
|
37
|
-
toCapData: import("
|
|
38
|
-
fromCapData: import("
|
|
39
|
-
serialize: import("
|
|
40
|
-
unserialize: import("
|
|
41
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
42
|
-
toCapData: import("
|
|
43
|
-
fromCapData: import("
|
|
44
|
-
serialize: import("
|
|
45
|
-
unserialize: import("
|
|
37
|
+
toCapData: import("@endo/marshal").ToCapData<string>;
|
|
38
|
+
fromCapData: import("@endo/marshal").FromCapData<string>;
|
|
39
|
+
serialize: import("@endo/marshal").ToCapData<string>;
|
|
40
|
+
unserialize: import("@endo/marshal").FromCapData<string>;
|
|
41
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
42
|
+
toCapData: import("@endo/marshal").ToCapData<string>;
|
|
43
|
+
fromCapData: import("@endo/marshal").FromCapData<string>;
|
|
44
|
+
serialize: import("@endo/marshal").ToCapData<string>;
|
|
45
|
+
unserialize: import("@endo/marshal").FromCapData<string>;
|
|
46
46
|
}>;
|
|
47
47
|
fromBoard: {
|
|
48
|
-
toCapData: import("
|
|
49
|
-
fromCapData: import("
|
|
50
|
-
serialize: import("
|
|
51
|
-
unserialize: import("
|
|
52
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
53
|
-
toCapData: import("
|
|
54
|
-
fromCapData: import("
|
|
55
|
-
serialize: import("
|
|
56
|
-
unserialize: import("
|
|
48
|
+
toCapData: import("@endo/marshal").ToCapData<string>;
|
|
49
|
+
fromCapData: import("@endo/marshal").FromCapData<string>;
|
|
50
|
+
serialize: import("@endo/marshal").ToCapData<string>;
|
|
51
|
+
unserialize: import("@endo/marshal").FromCapData<string>;
|
|
52
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
53
|
+
toCapData: import("@endo/marshal").ToCapData<string>;
|
|
54
|
+
fromCapData: import("@endo/marshal").FromCapData<string>;
|
|
55
|
+
serialize: import("@endo/marshal").ToCapData<string>;
|
|
56
|
+
unserialize: import("@endo/marshal").FromCapData<string>;
|
|
57
57
|
}>;
|
|
58
58
|
};
|
|
59
59
|
export function makeLoggingPresence(iface: string, log: (parts: unknown[]) => void): any;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* When marshaling a purse, payment, etc. we partition the slots
|
|
62
|
+
* using prefixes.
|
|
62
63
|
*/
|
|
63
64
|
export type WalletSlot<T extends Record<string, IdTable<any, any>>> = `${string & keyof T}:${Digits}`;
|
|
64
65
|
/**
|
|
@@ -66,7 +67,8 @@ export type WalletSlot<T extends Record<string, IdTable<any, any>>> = `${string
|
|
|
66
67
|
*/
|
|
67
68
|
export type KindSlot<K extends string> = `${K}:${Digits}`;
|
|
68
69
|
/**
|
|
69
|
-
*
|
|
70
|
+
* Since KindSlots always include a colon and BoardIds never do,
|
|
71
|
+
* we an mix them without confusion.
|
|
70
72
|
*/
|
|
71
73
|
export type MixedSlot<T extends Record<string, IdTable<any, any>>> = string;
|
|
72
74
|
/**
|
|
@@ -78,10 +80,12 @@ export type Digits = `1` | `12` | `123`;
|
|
|
78
80
|
/**
|
|
79
81
|
* <Value>
|
|
80
82
|
*/
|
|
81
|
-
export type IdTable<Slot, Val> = {
|
|
83
|
+
export type IdTable<Slot extends Key, Val extends PassableCap> = {
|
|
82
84
|
bySlot: MapStore<Slot, Val>;
|
|
83
85
|
byVal: MapStore<Val, Slot>;
|
|
84
86
|
};
|
|
85
87
|
export type ExportContext = ReturnType<typeof makeExportContext>;
|
|
86
88
|
export type ImportContext = ReturnType<typeof makeImportContext>;
|
|
89
|
+
import type { PassableCap } from '@endo/marshal';
|
|
90
|
+
import type { Key } from '@endo/patterns';
|
|
87
91
|
//# sourceMappingURL=marshal-contexts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marshal-contexts.d.ts","sourceRoot":"","sources":["marshal-contexts.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marshal-contexts.d.ts","sourceRoot":"","sources":["marshal-contexts.js"],"names":[],"mappings":"AAuHO;;;;;;;IAqFH;;;OAGG;sBAFQ,MAAM,SACN,KAAK;;IAMhB;;;OAGG;;IAIH;;;OAGG;;EAUN;AAcM,0DAFY,MAAM;IA8FrB;;;OAGG;;IAIH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;EAWN;AAwBM,2CAHI,MAAM,OACN,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,OAapC;;;;;uBA7W8B,CAAC,8CAAnB,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE;;;;qBAI5B,CAAC,mBAAJ,GAAG,CAAC,IAAI,MAAM,EAAE;;;;;sBA2CL,CAAC;;;;;;qBAGZ,GAAG,GAAG,IAAI,GAAG,KAAK;;;;oBAWL,IAAI,cAAT,GAAG,wBAFX;IACZ,MAAU,EAAE,QAAQ,CACK,IAAI,AADJ,EACL,GAAG,AADO,CAAC,CAAC;IAChC,KAAS,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;CAC5B;4BA8IU,UAAU,CAAC,OAAO,iBAAiB,CAAC;4BA+HpC,UAAU,CAAC,OAAO,iBAAiB,CAAC;iCA/VpB,eAAe;yBACvB,gBAAgB"}
|
package/src/marshal-contexts.js
CHANGED
|
@@ -6,7 +6,11 @@ import { DEFAULT_PREFIX } from '@agoric/vats/src/lib-board.js';
|
|
|
6
6
|
|
|
7
7
|
const { Fail, quote: q } = assert;
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @import {PassableCap} from '@endo/marshal';
|
|
11
|
+
* @import {Key} from '@endo/patterns';
|
|
12
|
+
* @import {BoardId} from '@agoric/vats/src/lib-board.js';
|
|
13
|
+
*/
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* ID from a board made with { prefix: DEFAULT_PREFIX }
|
|
@@ -23,7 +27,7 @@ const isDefaultBoardId = specimen => {
|
|
|
23
27
|
* using prefixes.
|
|
24
28
|
*
|
|
25
29
|
* @template {Record<string, IdTable<*,*>>} T
|
|
26
|
-
* @typedef {`${string & keyof T}:${Digits}`} WalletSlot
|
|
30
|
+
* @typedef {`${string & keyof T}:${Digits}`} WalletSlot
|
|
27
31
|
*/
|
|
28
32
|
/**
|
|
29
33
|
* @template {string} K
|
|
@@ -70,7 +74,7 @@ const parseWalletSlot = (tables, slot) => {
|
|
|
70
74
|
* we an mix them without confusion.
|
|
71
75
|
*
|
|
72
76
|
* @template {Record<string, IdTable<*,*>>} T
|
|
73
|
-
* @typedef {WalletSlot<T> | BoardId} MixedSlot
|
|
77
|
+
* @typedef {WalletSlot<T> | BoardId} MixedSlot
|
|
74
78
|
*/
|
|
75
79
|
/**
|
|
76
80
|
* @typedef {`1` | `12` | `123`} Digits - 1 or more digits.
|
|
@@ -79,8 +83,8 @@ const parseWalletSlot = (tables, slot) => {
|
|
|
79
83
|
*/
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
|
-
* @template Slot
|
|
83
|
-
* @template Val
|
|
86
|
+
* @template {Key} Slot
|
|
87
|
+
* @template {PassableCap} Val
|
|
84
88
|
*
|
|
85
89
|
* @typedef {{
|
|
86
90
|
* bySlot: MapStore<Slot, Val>,
|
|
@@ -89,9 +93,9 @@ const parseWalletSlot = (tables, slot) => {
|
|
|
89
93
|
*/
|
|
90
94
|
|
|
91
95
|
/**
|
|
92
|
-
* @template Slot
|
|
93
|
-
* @template Val
|
|
94
|
-
* @param {IdTable<Slot,
|
|
96
|
+
* @template {Key} Slot
|
|
97
|
+
* @template {PassableCap} Val
|
|
98
|
+
* @param {IdTable<Slot, PassableCap>} table
|
|
95
99
|
* @param {Slot} slot
|
|
96
100
|
* @param {Val} val
|
|
97
101
|
*/
|
|
@@ -126,13 +130,13 @@ export const makeExportContext = () => {
|
|
|
126
130
|
byVal: makeScalarMapStore(),
|
|
127
131
|
},
|
|
128
132
|
// TODO: offer, contact, dapp
|
|
129
|
-
/** @type {IdTable<number,
|
|
133
|
+
/** @type {IdTable<number, PassableCap>} */
|
|
130
134
|
unknown: {
|
|
131
135
|
bySlot: makeScalarMapStore(),
|
|
132
136
|
byVal: makeScalarMapStore(),
|
|
133
137
|
},
|
|
134
138
|
};
|
|
135
|
-
/** @type {IdTable<BoardId,
|
|
139
|
+
/** @type {IdTable<BoardId, PassableCap>} */
|
|
136
140
|
const boardObjects = {
|
|
137
141
|
bySlot: makeScalarMapStore(),
|
|
138
142
|
byVal: makeScalarMapStore(),
|
|
@@ -161,7 +165,7 @@ export const makeExportContext = () => {
|
|
|
161
165
|
let unknownNonce = 0;
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
|
-
* @param {
|
|
168
|
+
* @param {PassableCap} val
|
|
165
169
|
* @returns {MixedSlot<typeof walletObjects>}
|
|
166
170
|
*/
|
|
167
171
|
const valToSlot = val => {
|
|
@@ -181,7 +185,7 @@ export const makeExportContext = () => {
|
|
|
181
185
|
};
|
|
182
186
|
|
|
183
187
|
/**
|
|
184
|
-
* @template V
|
|
188
|
+
* @template {PassableCap} V
|
|
185
189
|
* @param {string & keyof typeof walletObjects} kind
|
|
186
190
|
* @param {IdTable<number, V>} table
|
|
187
191
|
*/
|
|
@@ -208,14 +212,14 @@ export const makeExportContext = () => {
|
|
|
208
212
|
purseEntries: walletObjects.purse.bySlot.entries,
|
|
209
213
|
/**
|
|
210
214
|
* @param {BoardId} id
|
|
211
|
-
* @param {
|
|
215
|
+
* @param {PassableCap} val
|
|
212
216
|
*/
|
|
213
217
|
initBoardId: (id, val) => {
|
|
214
218
|
initSlotVal(boardObjects, id, val);
|
|
215
219
|
},
|
|
216
220
|
/**
|
|
217
221
|
* @param {BoardId} id
|
|
218
|
-
* @param {
|
|
222
|
+
* @param {PassableCap} val
|
|
219
223
|
*/
|
|
220
224
|
ensureBoardId: (id, val) => {
|
|
221
225
|
if (boardObjects.byVal.has(val)) {
|
|
@@ -238,35 +242,35 @@ const defaultMakePresence = iface => {
|
|
|
238
242
|
* Make context for marshalling wallet or board data.
|
|
239
243
|
* To be imported into the client, which never exports objects.
|
|
240
244
|
*
|
|
241
|
-
* @param {(iface: string) =>
|
|
245
|
+
* @param {(iface: string) => PassableCap} [makePresence]
|
|
242
246
|
*/
|
|
243
247
|
export const makeImportContext = (makePresence = defaultMakePresence) => {
|
|
244
248
|
const walletObjects = {
|
|
245
|
-
/** @type {IdTable<number,
|
|
249
|
+
/** @type {IdTable<number, PassableCap>} */
|
|
246
250
|
purse: {
|
|
247
251
|
bySlot: makeScalarMapStore(),
|
|
248
252
|
byVal: makeScalarMapStore(),
|
|
249
253
|
},
|
|
250
|
-
/** @type {IdTable<number,
|
|
254
|
+
/** @type {IdTable<number, PassableCap>} */
|
|
251
255
|
payment: {
|
|
252
256
|
bySlot: makeScalarMapStore(),
|
|
253
257
|
byVal: makeScalarMapStore(),
|
|
254
258
|
},
|
|
255
|
-
/** @type {IdTable<number,
|
|
259
|
+
/** @type {IdTable<number, PassableCap>} */
|
|
256
260
|
unknown: {
|
|
257
261
|
bySlot: makeScalarMapStore(),
|
|
258
262
|
byVal: makeScalarMapStore(),
|
|
259
263
|
},
|
|
260
264
|
};
|
|
261
|
-
/** @type {IdTable<BoardId,
|
|
265
|
+
/** @type {IdTable<BoardId, PassableCap>} */
|
|
262
266
|
const boardObjects = {
|
|
263
267
|
bySlot: makeScalarMapStore(),
|
|
264
268
|
byVal: makeScalarMapStore(),
|
|
265
269
|
};
|
|
266
270
|
|
|
267
271
|
/**
|
|
268
|
-
* @template Slot
|
|
269
|
-
* @template Val
|
|
272
|
+
* @template {Key} Slot
|
|
273
|
+
* @template {PassableCap} Val
|
|
270
274
|
* @param {IdTable<Slot, Val>} table
|
|
271
275
|
* @param {Slot} slot
|
|
272
276
|
* @param {string} iface
|
|
@@ -308,7 +312,7 @@ export const makeImportContext = (makePresence = defaultMakePresence) => {
|
|
|
308
312
|
|
|
309
313
|
const valToSlot = {
|
|
310
314
|
fromBoard: val => boardObjects.byVal.get(val),
|
|
311
|
-
/** @param {
|
|
315
|
+
/** @param {PassableCap} val */
|
|
312
316
|
fromMyWallet: val => {
|
|
313
317
|
const kind = findKey(walletObjects, k => walletObjects[k].byVal.has(val));
|
|
314
318
|
if (kind === undefined) {
|
|
@@ -334,14 +338,14 @@ export const makeImportContext = (makePresence = defaultMakePresence) => {
|
|
|
334
338
|
return harden({
|
|
335
339
|
/**
|
|
336
340
|
* @param {BoardId} id
|
|
337
|
-
* @param {
|
|
341
|
+
* @param {PassableCap} val
|
|
338
342
|
*/
|
|
339
343
|
initBoardId: (id, val) => {
|
|
340
344
|
initSlotVal(boardObjects, id, val);
|
|
341
345
|
},
|
|
342
346
|
/**
|
|
343
347
|
* @param {BoardId} id
|
|
344
|
-
* @param {
|
|
348
|
+
* @param {PassableCap} val
|
|
345
349
|
*/
|
|
346
350
|
ensureBoardId: (id, val) => {
|
|
347
351
|
if (boardObjects.byVal.has(val)) {
|
package/src/offerWatcher.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function watchOfferOutcomes(watchers: OutcomeWatchers, seat: UserSeat): Promise<[unknown, 0 | 1, PaymentPKeywordRecord]>;
|
|
2
|
-
export function prepareOfferWatcher(baggage: import("@agoric/vat-data").Baggage): (walletHelper: any, deposit: any, offerSpec: OfferSpec, address: string, invitationAmount:
|
|
2
|
+
export function prepareOfferWatcher(baggage: import("@agoric/vat-data").Baggage): (walletHelper: any, deposit: any, offerSpec: OfferSpec, address: string, invitationAmount: import("@agoric/ertp/exported.js").SetAmount<import("@endo/patterns").Key>, seatRef: UserSeat<unknown>) => import("@endo/exo").GuardedKit<{
|
|
3
3
|
helper: {
|
|
4
4
|
/**
|
|
5
5
|
* @param {Record<string, unknown>} offerStatusUpdates
|
package/src/offers.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* id: OfferId,
|
|
7
7
|
* invitationSpec: import('./invitations.js').InvitationSpec,
|
|
8
8
|
* proposal: Proposal,
|
|
9
|
-
* offerArgs?:
|
|
9
|
+
* offerArgs?: any
|
|
10
10
|
* }} OfferSpec
|
|
11
11
|
*/
|
|
12
12
|
/** Value for "result" field when the result can't be published */
|
|
@@ -16,7 +16,7 @@ export type OfferSpec = {
|
|
|
16
16
|
id: OfferId;
|
|
17
17
|
invitationSpec: import("./invitations.js").InvitationSpec;
|
|
18
18
|
proposal: Proposal;
|
|
19
|
-
offerArgs?:
|
|
19
|
+
offerArgs?: any;
|
|
20
20
|
};
|
|
21
21
|
export type OfferStatus = OfferSpec & {
|
|
22
22
|
error?: string;
|
package/src/offers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;sBAbnC,MAAM,GAAG,MAAM;wBAIf;IACZ,EAAM,EAAE,OAAO,CAAC;IAChB,cAAkB,EAAE,OAAO,kBAAkB,EAAE,cAAc,CAAC;IAC9D,QAAY,EAAE,QAAQ,CAAC;IACvB,SAAa,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;sBAbnC,MAAM,GAAG,MAAM;wBAIf;IACZ,EAAM,EAAE,OAAO,CAAC;IAChB,cAAkB,EAAE,OAAO,kBAAkB,EAAE,cAAc,CAAC;IAC9D,QAAY,EAAE,QAAQ,CAAC;IACvB,SAAa,CAAC,EAAE,GAAG,CAAA;CAChB;0BAOS,SAAS,GAAG;IACxB,KAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,MAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,kBAAkB,CAAC;IAC/C,OAAS,CAAC,EAAE,mBAAmB,CAAC;CAC7B"}
|
package/src/offers.js
CHANGED
package/src/smartWallet.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export type OfferSpec = {
|
|
|
68
68
|
id: OfferId;
|
|
69
69
|
invitationSpec: import("./invitations").InvitationSpec;
|
|
70
70
|
proposal: Proposal;
|
|
71
|
-
offerArgs?:
|
|
71
|
+
offerArgs?: any;
|
|
72
72
|
};
|
|
73
73
|
export type ExecutorPowers = {
|
|
74
74
|
logger: {
|
|
@@ -151,7 +151,7 @@ export type UniqueParams = {
|
|
|
151
151
|
address: string;
|
|
152
152
|
bank: ERef<import("@agoric/vats/src/vat-bank.js").Bank>;
|
|
153
153
|
currentStorageNode: StorageNode;
|
|
154
|
-
invitationPurse: Purse<"set">;
|
|
154
|
+
invitationPurse: Purse<"set", InvitationDetails>;
|
|
155
155
|
walletStorageNode: StorageNode;
|
|
156
156
|
};
|
|
157
157
|
export type BrandDescriptorRegistry = Pick<MapStore<Brand, BrandDescriptor>, "has" | "get" | "values">;
|
package/src/smartWallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"AAoOA,kDAAmD;AAiB5C,4CAHI,OAAO,kBAAkB,EAAE,OAAO,UAClC,YAAY,
|
|
1
|
+
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"AAoOA,kDAAmD;AAiB5C,4CAHI,OAAO,kBAAkB,EAAE,OAAO,UAClC,YAAY,6BA67BV,IAAI,CAAC,YAAY,EAAE,oBAAoB,GAAG,mBAAmB,CAAC,GAAG;IAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;CAAC;IAvH5G;;;;;;OAMG;sCAHQ,OAAO,eAAe,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,mCAE5C,OAAO,CAAC,IAAI,CAAC;;QA1Q1B;;;;;;;;WAQG;yBAHQ,OAAO,GACL,OAAO,CAAC,MAAM,CAAC;;;QAyH5B;;;;;;WAMG;gCAHQ,SAAS,GACP,OAAO,CAAC,IAAI,CAAC;QAwG1B;;;;;;WAMG;8BAHQ,OAAO,GACL,OAAO,CAAC,IAAI,CAAC;;IAgF1B,sCAAsC;;IAKtC,sCAAsC;;;;;;;;;;;;;;IAuBtC;;;;OAIG;qCADQ,MAAM;IA+CxB;sBAxoCa,MAAM,GAAG,MAAM;wBAGhB;IACZ,EAAM,EAAE,OAAO,CAAC;IAChB,cAAkB,EAAE,OAAO,eAAe,EAAE,cAAc,CAAC;IAC3D,QAAY,EAAE,QAAQ,CAAC;IACvB,SAAa,CAAC,EAAE,GAAG,CAAA;CAChB;6BAIS;IACZ,MAAU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,CAAC,CAAC,CAAC;IAC3D,aAAiB,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,iBAAqB,EAAE,OAAO,6CAA6C,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACvG,kBAAsB,EAAE,OAAO,6CAA6C,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC/G,UAAc,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,aAAa,EAAE,WAAW,CAAC,CAAC;IACrE,cAAkB,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,iBAAqB,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;CAChE,CAAC;0BAEQ,eAAe,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE;2BAClC,EACT;0BAugCU,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC"}
|
package/src/smartWallet.js
CHANGED
|
@@ -62,7 +62,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
62
62
|
* id: OfferId,
|
|
63
63
|
* invitationSpec: import('./invitations').InvitationSpec,
|
|
64
64
|
* proposal: Proposal,
|
|
65
|
-
* offerArgs?:
|
|
65
|
+
* offerArgs?: any
|
|
66
66
|
* }} OfferSpec
|
|
67
67
|
*/
|
|
68
68
|
|
|
@@ -150,7 +150,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
150
150
|
* address: string,
|
|
151
151
|
* bank: ERef<import('@agoric/vats/src/vat-bank.js').Bank>,
|
|
152
152
|
* currentStorageNode: StorageNode,
|
|
153
|
-
* invitationPurse: Purse<'set'>,
|
|
153
|
+
* invitationPurse: Purse<'set', InvitationDetails>,
|
|
154
154
|
* walletStorageNode: StorageNode,
|
|
155
155
|
* }} UniqueParams
|
|
156
156
|
*
|
|
@@ -770,7 +770,6 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
770
770
|
const { registry, invitationBrand } = shared;
|
|
771
771
|
|
|
772
772
|
if (registry.has(brand)) {
|
|
773
|
-
// @ts-expect-error virtual purse
|
|
774
773
|
return E(state.bank).getPurse(brand);
|
|
775
774
|
} else if (invitationBrand === brand) {
|
|
776
775
|
return state.invitationPurse;
|
package/src/walletFactory.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export namespace customTermsShape {
|
|
2
|
-
let agoricNames:
|
|
3
|
-
let board:
|
|
4
|
-
let assetPublisher:
|
|
2
|
+
let agoricNames: globalThis.Pattern;
|
|
3
|
+
let board: globalThis.Pattern;
|
|
4
|
+
let assetPublisher: globalThis.Pattern;
|
|
5
5
|
}
|
|
6
6
|
export const privateArgsShape: import("@endo/patterns").Matcher;
|
|
7
7
|
export function publishDepositFacet(address: string, wallet: import("./smartWallet.js").SmartWallet, namesByAddressAdmin: ERef<import("@agoric/vats").NameAdmin>): Promise<unknown>;
|