@agoric/smart-wallet 0.5.4-other-dev-8f8782b.0 → 0.5.4-other-dev-3eb1a1d.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.
Files changed (41) hide show
  1. package/package.json +35 -26
  2. package/src/index.d.ts +2 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +2 -0
  5. package/src/invitations.d.ts +14 -10
  6. package/src/invitations.d.ts.map +1 -1
  7. package/src/invitations.js +35 -32
  8. package/src/marshal-contexts.d.ts +44 -41
  9. package/src/marshal-contexts.d.ts.map +1 -1
  10. package/src/marshal-contexts.js +68 -61
  11. package/src/offerWatcher.d.ts +52 -0
  12. package/src/offerWatcher.d.ts.map +1 -0
  13. package/src/offerWatcher.js +329 -0
  14. package/src/offers.d.ts +7 -31
  15. package/src/offers.d.ts.map +1 -1
  16. package/src/offers.js +9 -183
  17. package/src/proposals/upgrade-wallet-factory2-proposal.d.ts +23 -0
  18. package/src/proposals/upgrade-wallet-factory2-proposal.d.ts.map +1 -0
  19. package/src/proposals/upgrade-wallet-factory2-proposal.js +60 -0
  20. package/src/proposals/upgrade-walletFactory-proposal.d.ts +1 -1
  21. package/src/proposals/upgrade-walletFactory-proposal.d.ts.map +1 -1
  22. package/src/proposals/upgrade-walletFactory-proposal.js +46 -23
  23. package/src/smartWallet.d.ts +101 -66
  24. package/src/smartWallet.d.ts.map +1 -1
  25. package/src/smartWallet.js +576 -216
  26. package/src/typeGuards.d.ts +1 -1
  27. package/src/types-index.d.ts +2 -0
  28. package/src/types-index.js +2 -0
  29. package/src/types.d.ts +35 -41
  30. package/src/types.d.ts.map +1 -0
  31. package/src/types.ts +90 -0
  32. package/src/utils.d.ts +17 -14
  33. package/src/utils.d.ts.map +1 -1
  34. package/src/utils.js +19 -6
  35. package/src/walletFactory.d.ts +24 -78
  36. package/src/walletFactory.d.ts.map +1 -1
  37. package/src/walletFactory.js +61 -37
  38. package/CHANGELOG.md +0 -180
  39. package/src/payments.d.ts +0 -20
  40. package/src/payments.d.ts.map +0 -1
  41. package/src/payments.js +0 -89
package/package.json CHANGED
@@ -1,44 +1,47 @@
1
1
  {
2
2
  "name": "@agoric/smart-wallet",
3
- "version": "0.5.4-other-dev-8f8782b.0+8f8782b",
3
+ "version": "0.5.4-other-dev-3eb1a1d.0+3eb1a1d",
4
4
  "description": "Wallet contract",
5
5
  "type": "module",
6
+ "main": "src/index.js",
6
7
  "scripts": {
7
8
  "build": "yarn build:bundles",
8
9
  "build:bundles": "node ./scripts/build-bundles.js",
9
- "prepack": "tsc --build jsconfig.build.json",
10
- "postpack": "git clean -f '*.d.ts*'",
10
+ "prepack": "tsc --build tsconfig.build.json",
11
+ "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
11
12
  "test": "ava",
12
13
  "test:xs": "exit 0",
13
14
  "lint": "run-s --continue-on-error lint:*",
14
15
  "lint-fix": "yarn lint:eslint --fix",
15
- "lint:types": "tsc -p jsconfig.json",
16
+ "lint:types": "tsc",
16
17
  "lint:eslint": "eslint ."
17
18
  },
18
19
  "devDependencies": {
19
- "@agoric/cosmic-proto": "0.3.1-other-dev-8f8782b.0+8f8782b",
20
- "@endo/bundle-source": "2.5.2-upstream-rollup",
21
- "@endo/captp": "3.1.1",
22
- "@endo/init": "0.5.56",
23
- "ava": "^5.2.0",
20
+ "@agoric/casting": "0.4.3-other-dev-3eb1a1d.0+3eb1a1d",
21
+ "@agoric/cosmic-proto": "0.4.1-other-dev-3eb1a1d.0+3eb1a1d",
22
+ "@agoric/swingset-vat": "0.32.3-other-dev-3eb1a1d.0+3eb1a1d",
23
+ "@endo/bundle-source": "^3.5.0",
24
+ "@endo/captp": "^4.4.3",
25
+ "@endo/init": "^1.1.7",
26
+ "ava": "^5.3.0",
24
27
  "import-meta-resolve": "^2.2.1"
25
28
  },
26
29
  "dependencies": {
27
- "@agoric/assert": "0.6.1-other-dev-8f8782b.0+8f8782b",
28
- "@agoric/casting": "0.4.3-other-dev-8f8782b.0+8f8782b",
29
- "@agoric/ertp": "0.16.3-other-dev-8f8782b.0+8f8782b",
30
- "@agoric/internal": "0.3.3-other-dev-8f8782b.0+8f8782b",
31
- "@agoric/notifier": "0.6.3-other-dev-8f8782b.0+8f8782b",
32
- "@agoric/store": "0.9.3-other-dev-8f8782b.0+8f8782b",
33
- "@agoric/swingset-vat": "0.32.3-other-dev-8f8782b.0+8f8782b",
34
- "@agoric/vat-data": "0.5.3-other-dev-8f8782b.0+8f8782b",
35
- "@agoric/vats": "0.15.2-other-dev-8f8782b.0+8f8782b",
36
- "@agoric/zoe": "0.26.3-other-dev-8f8782b.0+8f8782b",
37
- "@endo/eventual-send": "0.17.2",
38
- "@endo/far": "0.2.18",
39
- "@endo/marshal": "0.8.5",
40
- "@endo/nat": "4.1.27",
41
- "@endo/promise-kit": "0.2.56"
30
+ "@agoric/ertp": "0.16.3-other-dev-3eb1a1d.0+3eb1a1d",
31
+ "@agoric/internal": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
32
+ "@agoric/notifier": "0.6.3-other-dev-3eb1a1d.0+3eb1a1d",
33
+ "@agoric/store": "0.9.3-other-dev-3eb1a1d.0+3eb1a1d",
34
+ "@agoric/vat-data": "0.5.3-other-dev-3eb1a1d.0+3eb1a1d",
35
+ "@agoric/vats": "0.15.2-other-dev-3eb1a1d.0+3eb1a1d",
36
+ "@agoric/vow": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
37
+ "@agoric/zoe": "0.26.3-other-dev-3eb1a1d.0+3eb1a1d",
38
+ "@agoric/zone": "0.2.3-other-dev-3eb1a1d.0+3eb1a1d",
39
+ "@endo/errors": "^1.2.8",
40
+ "@endo/eventual-send": "^1.2.8",
41
+ "@endo/far": "^1.1.9",
42
+ "@endo/marshal": "^1.6.2",
43
+ "@endo/nat": "^5.0.13",
44
+ "@endo/promise-kit": "^1.1.8"
42
45
  },
43
46
  "files": [
44
47
  "src/"
@@ -56,12 +59,18 @@
56
59
  "homepage": "https://github.com/Agoric/agoric#readme",
57
60
  "ava": {
58
61
  "files": [
59
- "test/**/test-*.js"
62
+ "test/**/*.test.*"
63
+ ],
64
+ "require": [
65
+ "@endo/init/debug.js"
60
66
  ],
61
67
  "timeout": "2m"
62
68
  },
63
69
  "publishConfig": {
64
70
  "access": "public"
65
71
  },
66
- "gitHead": "8f8782bc52393e9d4fc82523ecf31cab429b11b3"
72
+ "typeCoverage": {
73
+ "atLeast": 94.64
74
+ },
75
+ "gitHead": "3eb1a1d2d75b2b4a94807cd3bf759bc9fc531f05"
67
76
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./types-index.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // eslint-disable-next-line import/export
2
+ export * from './types-index.js'; // no named exports
@@ -1,45 +1,49 @@
1
- export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<NameHub>, invitationBrand: Brand<'set'>, invitationsPurse: Purse<'set'>, getInvitationContinuation: (fromOfferId: string) => import('./types').RemoteInvitationMakers): (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
  */
5
5
  export type InvitationSpec = AgoricContractInvitationSpec | ContractInvitationSpec | PurseInvitationSpec | ContinuingInvitationSpec;
6
6
  /**
7
7
  * source of invitation is a chain of calls starting with an agoricName
8
+ *
8
9
  * - the start of the pipe is a lookup of instancePath within agoricNames
9
10
  * - each entry in the callPipe executes a call on the preceding result
10
11
  * - the end of the pipe is expected to return an Invitation
11
12
  */
12
13
  export type AgoricContractInvitationSpec = {
13
- source: 'agoricContract';
14
+ source: "agoricContract";
14
15
  instancePath: string[];
15
- callPipe: Array<[methodName: string, methodArgs?: any[]]>;
16
+ callPipe: [methodName: string, methodArgs?: any[]][];
16
17
  };
17
18
  /**
18
19
  * source is a contract (in which case this takes an Instance to look up in zoe)
19
20
  */
20
21
  export type ContractInvitationSpec = {
21
- source: 'contract';
22
+ source: "contract";
22
23
  instance: Instance;
23
24
  publicInvitationMaker: string;
24
25
  invitationArgs?: any[];
25
26
  };
26
27
  /**
27
- * the invitation is already in your Zoe "invitation" purse so we need to query it
28
+ * the invitation is already in your Zoe "invitation" purse so we need to query
29
+ * it
30
+ *
28
31
  * - use the find/query invitation by kvs thing
29
32
  */
30
33
  export type PurseInvitationSpec = {
31
- source: 'purse';
34
+ source: "purse";
32
35
  instance: Instance;
33
36
  description: string;
34
37
  };
35
38
  /**
36
- * continuing invitation in which the offer result from a previous invitation had an `invitationMakers` property
39
+ * continuing invitation in which the offer result from a previous invitation
40
+ * had an `invitationMakers` property
37
41
  */
38
42
  export type ContinuingInvitationSpec = {
39
- source: 'continuing';
40
- previousOffer: import('./offers.js').OfferId;
43
+ source: "continuing";
44
+ previousOffer: import("./offers.js").OfferId;
41
45
  invitationMakerName: string;
42
46
  invitationArgs?: any[];
43
47
  };
44
- export type InvitationsPurseQuery = Pick<InvitationDetails, 'description' | 'instance'>;
48
+ export type InvitationsPurseQuery = Pick<InvitationDetails, "description" | "instance">;
45
49
  //# sourceMappingURL=invitations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAkEO,2CANI,KAAK,UAAU,CAAC,eAChB,KAAK,OAAO,CAAC,mBACb,MAAM,KAAK,CAAC,oBACZ,MAAM,KAAK,CAAC,2CACE,MAAM,KAAK,OAAO,SAAS,EAAE,sBAAsB,UAsFxD,cAAc,KAAK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CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;CACtD;;;;qCAQS;IACR,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;;;;;;;kCAGS;IACR,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;;;;;uCAOS;IACR,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,OAAO,aAAa,EAAE,OAAO,CAAC;IAC7C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;oCAMS,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC"}
@@ -1,56 +1,61 @@
1
1
  import { AmountMath } from '@agoric/ertp';
2
2
  import { mustMatch } from '@agoric/store';
3
- import { InvitationHandleShape } from '@agoric/zoe/src/typeGuards.js';
3
+ import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
4
+ import { Fail } from '@endo/errors';
4
5
  import { E } from '@endo/far';
5
6
  import { shape } from './typeGuards.js';
6
7
 
7
- // Ambient types. Needed only for dev but this does a runtime import.
8
- import '@agoric/zoe/exported.js';
9
-
10
- const { Fail } = assert;
11
-
12
8
  // A safety limit
13
9
  const MAX_PIPE_LENGTH = 2;
14
10
 
15
11
  /**
16
- * @typedef {AgoricContractInvitationSpec | ContractInvitationSpec | PurseInvitationSpec | ContinuingInvitationSpec} InvitationSpec
17
- * Specify how to produce an invitation. See each type in the union for details.
12
+ * @typedef {AgoricContractInvitationSpec
13
+ * | ContractInvitationSpec
14
+ * | PurseInvitationSpec
15
+ * | ContinuingInvitationSpec} InvitationSpec
16
+ * Specify how to produce an invitation. See each type in the union for details.
18
17
  */
19
18
 
20
19
  /**
21
20
  * @typedef {{
22
- * source: 'agoricContract',
23
- * instancePath: string[],
24
- * callPipe: Array<[methodName: string, methodArgs?: any[]]>,
21
+ * source: 'agoricContract';
22
+ * instancePath: string[];
23
+ * callPipe: [methodName: string, methodArgs?: any[]][];
25
24
  * }} AgoricContractInvitationSpec
26
- * source of invitation is a chain of calls starting with an agoricName
25
+ * source of invitation is a chain of calls starting with an agoricName
26
+ *
27
27
  * - the start of the pipe is a lookup of instancePath within agoricNames
28
28
  * - each entry in the callPipe executes a call on the preceding result
29
29
  * - the end of the pipe is expected to return an Invitation
30
30
  *
31
+ *
31
32
  * @typedef {{
32
- * source: 'contract',
33
- * instance: Instance,
34
- * publicInvitationMaker: string,
35
- * invitationArgs?: any[],
33
+ * source: 'contract';
34
+ * instance: Instance;
35
+ * publicInvitationMaker: string;
36
+ * invitationArgs?: any[];
36
37
  * }} ContractInvitationSpec
37
- * source is a contract (in which case this takes an Instance to look up in zoe)
38
+ * source is a contract (in which case this takes an Instance to look up in zoe)
38
39
  *
39
40
  * @typedef {{
40
- * source: 'purse',
41
- * instance: Instance,
42
- * description: string,
41
+ * source: 'purse';
42
+ * instance: Instance;
43
+ * description: string;
43
44
  * }} PurseInvitationSpec
44
- * the invitation is already in your Zoe "invitation" purse so we need to query it
45
+ * the invitation is already in your Zoe "invitation" purse so we need to query
46
+ * it
47
+ *
45
48
  * - use the find/query invitation by kvs thing
46
49
  *
50
+ *
47
51
  * @typedef {{
48
- * source: 'continuing',
49
- * previousOffer: import('./offers.js').OfferId,
50
- * invitationMakerName: string,
51
- * invitationArgs?: any[],
52
+ * source: 'continuing';
53
+ * previousOffer: import('./offers.js').OfferId;
54
+ * invitationMakerName: string;
55
+ * invitationArgs?: any[];
52
56
  * }} ContinuingInvitationSpec
53
- * continuing invitation in which the offer result from a previous invitation had an `invitationMakers` property
57
+ * continuing invitation in which the offer result from a previous invitation
58
+ * had an `invitationMakers` property
54
59
  */
55
60
 
56
61
  /**
@@ -59,10 +64,10 @@ const MAX_PIPE_LENGTH = 2;
59
64
 
60
65
  /**
61
66
  * @param {ERef<ZoeService>} zoe
62
- * @param {ERef<NameHub>} agoricNames
67
+ * @param {ERef<import('@agoric/vats').NameHub>} agoricNames
63
68
  * @param {Brand<'set'>} invitationBrand
64
- * @param {Purse<'set'>} invitationsPurse
65
- * @param {(fromOfferId: string) => import('./types').RemoteInvitationMakers} getInvitationContinuation
69
+ * @param {Purse<'set', InvitationDetails>} invitationsPurse
70
+ * @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation
66
71
  */
67
72
  export const makeInvitationsHelper = (
68
73
  zoe,
@@ -87,7 +92,7 @@ export const makeInvitationsHelper = (
87
92
  }
88
93
 
89
94
  const invitation = await eref;
90
- mustMatch(invitation, InvitationHandleShape);
95
+ mustMatch(invitation, InvitationShape);
91
96
  return invitation;
92
97
  },
93
98
  /** @type {(spec: ContractInvitationSpec) => Promise<Invitation>} */
@@ -103,9 +108,7 @@ export const makeInvitationsHelper = (
103
108
  mustMatch(spec, shape.PurseInvitationSpec);
104
109
 
105
110
  const { instance, description } = spec;
106
- // @ts-expect-error TS thinks it's always true. I'm doubtful.
107
111
  (instance && description) || Fail`missing instance or description`;
108
- /** @type {Amount<'set'>} */
109
112
  const purseAmount = await E(invitationsPurse).getCurrentAmount();
110
113
  const invitations = AmountMath.getValue(invitationBrand, purseAmount);
111
114
 
@@ -1,65 +1,64 @@
1
1
  export function makeExportContext(): {
2
- toCapData: import("@endo/marshal/src/marshal").ToCapData<string>;
3
- fromCapData: import("@endo/marshal/src/marshal").FromCapData<string>;
4
- serialize: import("@endo/marshal/src/marshal").ToCapData<string>;
5
- unserialize: import("@endo/marshal/src/marshal").FromCapData<string>;
6
- savePurseActions: (val: Purse<AssetKind>) => void;
7
- savePaymentActions: (val: Payment<AssetKind>) => void;
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
+ savePurseActions: (val: globalThis.Purse) => void;
7
+ savePaymentActions: (val: globalThis.Payment) => void;
8
8
  /**
9
9
  * @param {number} id
10
10
  * @param {Purse} purse
11
11
  */
12
12
  initPurseId: (id: number, purse: Purse) => void;
13
- purseEntries: (keyPatt?: any, valuePatt?: any) => Iterable<[number, Purse<AssetKind>]>;
13
+ purseEntries: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[number, globalThis.Purse]>;
14
14
  /**
15
15
  * @param {BoardId} id
16
- * @param {unknown} val
16
+ * @param {RemotableObject} val
17
17
  */
18
- initBoardId: (id: BoardId, val: unknown) => void;
18
+ initBoardId: (id: BoardId, val: RemotableObject) => void;
19
19
  /**
20
20
  * @param {BoardId} id
21
- * @param {unknown} val
21
+ * @param {RemotableObject} val
22
22
  */
23
- ensureBoardId: (id: BoardId, val: unknown) => void;
23
+ ensureBoardId: (id: BoardId, val: RemotableObject) => void;
24
24
  };
25
- export function makeImportContext(makePresence?: ((iface: string) => unknown) | undefined): {
25
+ export function makeImportContext(makePresence?: ((iface: string) => PassableCap) | undefined): {
26
26
  /**
27
27
  * @param {BoardId} id
28
- * @param {unknown} val
28
+ * @param {PassableCap} val
29
29
  */
30
- initBoardId: (id: BoardId, val: unknown) => void;
30
+ initBoardId: (id: BoardId, val: PassableCap) => void;
31
31
  /**
32
32
  * @param {BoardId} id
33
- * @param {unknown} val
33
+ * @param {PassableCap} val
34
34
  */
35
- ensureBoardId: (id: BoardId, val: unknown) => void;
35
+ ensureBoardId: (id: BoardId, val: PassableCap) => void;
36
36
  fromMyWallet: {
37
- toCapData: import("@endo/marshal/src/marshal").ToCapData<string>;
38
- fromCapData: import("@endo/marshal/src/marshal").FromCapData<string>;
39
- serialize: import("@endo/marshal/src/marshal").ToCapData<string>;
40
- unserialize: import("@endo/marshal/src/marshal").FromCapData<string>;
41
- } & import("@endo/eventual-send").RemotableBrand<{}, {
42
- toCapData: import("@endo/marshal/src/marshal").ToCapData<string>;
43
- fromCapData: import("@endo/marshal/src/marshal").FromCapData<string>;
44
- serialize: import("@endo/marshal/src/marshal").ToCapData<string>;
45
- unserialize: import("@endo/marshal/src/marshal").FromCapData<string>;
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
+ } & 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("@endo/marshal/src/marshal").ToCapData<string>;
49
- fromCapData: import("@endo/marshal/src/marshal").FromCapData<string>;
50
- serialize: import("@endo/marshal/src/marshal").ToCapData<string>;
51
- unserialize: import("@endo/marshal/src/marshal").FromCapData<string>;
52
- } & import("@endo/eventual-send").RemotableBrand<{}, {
53
- toCapData: import("@endo/marshal/src/marshal").ToCapData<string>;
54
- fromCapData: import("@endo/marshal/src/marshal").FromCapData<string>;
55
- serialize: import("@endo/marshal/src/marshal").ToCapData<string>;
56
- unserialize: import("@endo/marshal/src/marshal").FromCapData<string>;
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
+ } & 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
- export type BoardId = import('@agoric/vats/src/lib-board.js').BoardId;
61
60
  /**
62
- * <T>
61
+ * When marshaling a purse, payment, etc. we partition the slots using prefixes.
63
62
  */
64
63
  export type WalletSlot<T extends Record<string, IdTable<any, any>>> = `${string & keyof T}:${Digits}`;
65
64
  /**
@@ -67,22 +66,26 @@ export type WalletSlot<T extends Record<string, IdTable<any, any>>> = `${string
67
66
  */
68
67
  export type KindSlot<K extends string> = `${K}:${Digits}`;
69
68
  /**
70
- * <T>
69
+ * Since KindSlots always include a colon and BoardIds never do, we an mix them
70
+ * without confusion.
71
71
  */
72
72
  export type MixedSlot<T extends Record<string, IdTable<any, any>>> = WalletSlot<T> | BoardId;
73
73
  /**
74
- * - 1 or more digits.
75
- * NOTE: the typescript definition here is more restrictive than
76
- * actual usage.
74
+ * - 1 or more digits. NOTE: the typescript
75
+ * definition here is more restrictive than actual usage.
77
76
  */
78
77
  export type Digits = `1` | `12` | `123`;
79
78
  /**
80
79
  * <Value>
81
80
  */
82
- export type IdTable<Slot, Val> = {
81
+ export type IdTable<Slot extends Key, Val extends PassableCap> = {
83
82
  bySlot: MapStore<Slot, Val>;
84
83
  byVal: MapStore<Val, Slot>;
85
84
  };
86
85
  export type ExportContext = ReturnType<typeof makeExportContext>;
87
86
  export type ImportContext = ReturnType<typeof makeImportContext>;
87
+ import type { BoardId } from '@agoric/vats/src/lib-board.js';
88
+ import type { RemotableObject } from '@endo/marshal';
89
+ import type { PassableCap } from '@endo/marshal';
90
+ import type { Key } from '@endo/patterns';
88
91
  //# sourceMappingURL=marshal-contexts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"marshal-contexts.d.ts","sourceRoot":"","sources":["marshal-contexts.js"],"names":[],"mappings":"AAmHO;;;;;;;IAqFH;;;OAGG;sBAFQ,MAAM,S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