@agoric/smart-wallet 0.5.4-dev-e3b41dc.0 → 0.5.4-dev-c9ce088.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 CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@agoric/smart-wallet",
3
- "version": "0.5.4-dev-e3b41dc.0+e3b41dc",
3
+ "version": "0.5.4-dev-c9ce088.0+c9ce088",
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",
@@ -16,8 +17,8 @@
16
17
  "lint:eslint": "eslint ."
17
18
  },
18
19
  "devDependencies": {
19
- "@agoric/cosmic-proto": "0.4.1-dev-e3b41dc.0+e3b41dc",
20
- "@agoric/swingset-vat": "0.32.3-dev-e3b41dc.0+e3b41dc",
20
+ "@agoric/cosmic-proto": "0.4.1-dev-c9ce088.0+c9ce088",
21
+ "@agoric/swingset-vat": "0.32.3-dev-c9ce088.0+c9ce088",
21
22
  "@endo/bundle-source": "^3.4.0",
22
23
  "@endo/captp": "^4.3.0",
23
24
  "@endo/init": "^1.1.4",
@@ -25,16 +26,16 @@
25
26
  "import-meta-resolve": "^2.2.1"
26
27
  },
27
28
  "dependencies": {
28
- "@agoric/casting": "0.4.3-dev-e3b41dc.0+e3b41dc",
29
- "@agoric/ertp": "0.16.3-dev-e3b41dc.0+e3b41dc",
30
- "@agoric/internal": "0.3.3-dev-e3b41dc.0+e3b41dc",
31
- "@agoric/notifier": "0.6.3-dev-e3b41dc.0+e3b41dc",
32
- "@agoric/store": "0.9.3-dev-e3b41dc.0+e3b41dc",
33
- "@agoric/vat-data": "0.5.3-dev-e3b41dc.0+e3b41dc",
34
- "@agoric/vats": "0.15.2-dev-e3b41dc.0+e3b41dc",
35
- "@agoric/vow": "0.1.1-dev-e3b41dc.0+e3b41dc",
36
- "@agoric/zoe": "0.26.3-dev-e3b41dc.0+e3b41dc",
37
- "@agoric/zone": "0.2.3-dev-e3b41dc.0+e3b41dc",
29
+ "@agoric/casting": "0.4.3-dev-c9ce088.0+c9ce088",
30
+ "@agoric/ertp": "0.16.3-dev-c9ce088.0+c9ce088",
31
+ "@agoric/internal": "0.3.3-dev-c9ce088.0+c9ce088",
32
+ "@agoric/notifier": "0.6.3-dev-c9ce088.0+c9ce088",
33
+ "@agoric/store": "0.9.3-dev-c9ce088.0+c9ce088",
34
+ "@agoric/vat-data": "0.5.3-dev-c9ce088.0+c9ce088",
35
+ "@agoric/vats": "0.15.2-dev-c9ce088.0+c9ce088",
36
+ "@agoric/vow": "0.1.1-dev-c9ce088.0+c9ce088",
37
+ "@agoric/zoe": "0.26.3-dev-c9ce088.0+c9ce088",
38
+ "@agoric/zone": "0.2.3-dev-c9ce088.0+c9ce088",
38
39
  "@endo/errors": "^1.2.5",
39
40
  "@endo/eventual-send": "^1.2.5",
40
41
  "@endo/far": "^1.1.5",
@@ -71,5 +72,5 @@
71
72
  "typeCoverage": {
72
73
  "atLeast": 94.51
73
74
  },
74
- "gitHead": "e3b41dc204ce335217bf18ed4889aba18734d8f6"
75
+ "gitHead": "c9ce08800ded20a0dc4039b64f470cafbbd96277"
75
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
@@ -0,0 +1,2 @@
1
+ // Export all the types this package provides
2
+ export * from './types.js';
@@ -0,0 +1,2 @@
1
+ // Empty JS file to correspond with its .d.ts twin
2
+ export {};
package/src/types.d.ts CHANGED
@@ -4,17 +4,9 @@
4
4
  * Similar to types.js but in TypeScript syntax because some types here need it.
5
5
  * Downside is it can't reference any ambient types, which most of agoric-sdk type are presently.
6
6
  */
7
-
8
- import type { ERef } from '@endo/far';
9
- import type { CapData } from '@endo/marshal';
10
- import type { agoric } from '@agoric/cosmic-proto';
11
7
  import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
12
- import type { StoredFacet } from '@agoric/internal/src/lib-chainStorage.js';
13
8
  import type { PublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
14
9
  import type { OfferSpec } from './offers.js';
15
-
16
- declare const CapDataShape: unique symbol;
17
-
18
10
  /**
19
11
  * A petname can either be a plain string or a path for which the first element
20
12
  * is a petname for the origin, and the rest of the elements are a snapshot of
@@ -22,54 +14,44 @@ declare const CapDataShape: unique symbol;
22
14
  * using plain strings, for consistency.
23
15
  */
24
16
  export type Petname = string | string[];
25
-
26
- export type InvitationMakers = Record<
27
- string,
28
- (...args: any[]) => Promise<Invitation>
29
- >;
30
-
31
- export type PublicSubscribers = Record<string, PublicTopic>;
32
-
17
+ export type InvitationMakers = Record<string, (...args: any[]) => Promise<Invitation>>;
18
+ export type PublicSubscribers = Record<string, PublicTopic<unknown>>;
33
19
  export interface ContinuingOfferResult {
34
- invitationMakers: InvitationMakers;
35
- publicSubscribers: PublicSubscribers;
20
+ invitationMakers: InvitationMakers;
21
+ publicSubscribers: PublicSubscribers;
36
22
  }
37
-
38
23
  export type Cell<T> = {
39
- get: () => T;
40
- set(val: T): void;
24
+ get: () => T;
25
+ set(val: T): void;
41
26
  };
42
-
43
27
  /**
44
28
  * Defined by walletAction struct in msg_server.go
45
29
  *
46
30
  * @see {agoric.swingset.MsgWalletAction} and walletSpendAction in msg_server.go
47
31
  */
48
32
  export type WalletActionMsg = {
49
- type: 'WALLET_ACTION';
50
- /** base64 of Uint8Array of bech32 data */
51
- owner: string;
52
- /** JSON of marshalled BridgeAction */
53
- action: string;
54
- blockHeight: unknown; // int64
55
- blockTime: unknown; // int64
33
+ type: 'WALLET_ACTION';
34
+ /** base64 of Uint8Array of bech32 data */
35
+ owner: string;
36
+ /** JSON of marshalled BridgeAction */
37
+ action: string;
38
+ blockHeight: unknown;
39
+ blockTime: unknown;
56
40
  };
57
-
58
41
  /**
59
42
  * Defined by walletSpendAction struct in msg_server.go
60
43
  *
61
44
  * @see {agoric.swingset.MsgWalletSpendAction} and walletSpendAction in msg_server.go
62
45
  */
63
46
  export type WalletSpendActionMsg = {
64
- type: 'WALLET_SPEND_ACTION';
65
- /** base64 of Uint8Array of bech32 data */
66
- owner: string;
67
- /** JSON of BridgeActionCapData */
68
- spendAction: string;
69
- blockHeight: unknown; // int64
70
- blockTime: unknown; // int64
47
+ type: 'WALLET_SPEND_ACTION';
48
+ /** base64 of Uint8Array of bech32 data */
49
+ owner: string;
50
+ /** JSON of BridgeActionCapData */
51
+ spendAction: string;
52
+ blockHeight: unknown;
53
+ blockTime: unknown;
71
54
  };
72
-
73
55
  /**
74
56
  * Messages transmitted over Cosmos chain, cryptographically verifying that the
75
57
  * message came from the 'owner'.
@@ -78,11 +60,8 @@ export type WalletSpendActionMsg = {
78
60
  * the sending of the message (as is the case for WALLET_SPEND_ACTION).
79
61
  */
80
62
  export type WalletBridgeMsg = WalletActionMsg | WalletSpendActionMsg;
81
-
82
63
  /**
83
64
  * Used for clientSupport helpers
84
65
  */
85
- export type OfferMaker = (
86
- agoricNames: AgoricNamesRemotes,
87
- ...rest: any[]
88
- ) => OfferSpec;
66
+ export type OfferMaker = (agoricNames: AgoricNamesRemotes, ...rest: any[]) => OfferSpec;
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C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
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @file Some types for smart-wallet contract
3
+ *
4
+ * Similar to types.js but in TypeScript syntax because some types here need it.
5
+ * Downside is it can't reference any ambient types, which most of agoric-sdk type are presently.
6
+ */
7
+
8
+ import type { agoric } from '@agoric/cosmic-proto/agoric/bundle.js';
9
+ import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
10
+ import type { PublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
11
+ import type { OfferSpec } from './offers.js';
12
+
13
+ declare const CapDataShape: unique symbol;
14
+
15
+ /**
16
+ * A petname can either be a plain string or a path for which the first element
17
+ * is a petname for the origin, and the rest of the elements are a snapshot of
18
+ * the names that were first given by that origin. We are migrating away from
19
+ * using plain strings, for consistency.
20
+ */
21
+ export type Petname = string | string[];
22
+
23
+ export type InvitationMakers = Record<
24
+ string,
25
+ (...args: any[]) => Promise<Invitation>
26
+ >;
27
+
28
+ export type PublicSubscribers = Record<string, PublicTopic<unknown>>;
29
+
30
+ export interface ContinuingOfferResult {
31
+ invitationMakers: InvitationMakers;
32
+ publicSubscribers: PublicSubscribers;
33
+ }
34
+
35
+ export type Cell<T> = {
36
+ get: () => T;
37
+ set(val: T): void;
38
+ };
39
+
40
+ /**
41
+ * Defined by walletAction struct in msg_server.go
42
+ *
43
+ * @see {agoric.swingset.MsgWalletAction} and walletSpendAction in msg_server.go
44
+ */
45
+ export type WalletActionMsg = {
46
+ type: 'WALLET_ACTION';
47
+ /** base64 of Uint8Array of bech32 data */
48
+ owner: string;
49
+ /** JSON of marshalled BridgeAction */
50
+ action: string;
51
+ blockHeight: unknown; // int64
52
+ blockTime: unknown; // int64
53
+ };
54
+
55
+ /**
56
+ * Defined by walletSpendAction struct in msg_server.go
57
+ *
58
+ * @see {agoric.swingset.MsgWalletSpendAction} and walletSpendAction in msg_server.go
59
+ */
60
+ export type WalletSpendActionMsg = {
61
+ type: 'WALLET_SPEND_ACTION';
62
+ /** base64 of Uint8Array of bech32 data */
63
+ owner: string;
64
+ /** JSON of BridgeActionCapData */
65
+ spendAction: string;
66
+ blockHeight: unknown; // int64
67
+ blockTime: unknown; // int64
68
+ };
69
+
70
+ /**
71
+ * Messages transmitted over Cosmos chain, cryptographically verifying that the
72
+ * message came from the 'owner'.
73
+ *
74
+ * The two wallet actions are distinguished by whether the user had to confirm
75
+ * the sending of the message (as is the case for WALLET_SPEND_ACTION).
76
+ */
77
+ export type WalletBridgeMsg = WalletActionMsg | WalletSpendActionMsg;
78
+
79
+ /**
80
+ * Used for clientSupport helpers
81
+ */
82
+ export type OfferMaker = (
83
+ agoricNames: AgoricNamesRemotes,
84
+ ...rest: any[]
85
+ ) => OfferSpec;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAIA,yDAAyD;AAEzD,sDAAuD;AAKhD;;;wBAYc,OAAO;yBACN,MAAM;sBACT,QAAQ;;;;;2BAOd,OAAO,kBAAkB,EAAE,YAAY,GAAG,EAAE;EAgExD;AAaM,yCAHI,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,CAAC;;oBAnF/C,OAAO;qBACN,MAAM;kBACT,QAAQ;;;;EA6F1B;AAMM,wCAHI,OAAO,iBAAiB,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAYjD;AASM,2KAFM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAW/C;mCAtDa,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,OAAO,CAAC;6BA7F1B,aAAa;iCAAb,aAAa"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAIA,yDAAyD;AAEzD,sDAAuD;AAKhD;;;wBAYc,OAAO;yBACN,MAAM;sBACT,QAAQ;;;;;2BAOd,OAAO,kBAAkB,EAAE,YAAY,GAAG,EAAE;EAgExD;AAaM,yCAHI,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,CAAC;;oBAnF/C,OAAO;qBACN,MAAM;kBACT,QAAQ;;;;EA6F1B;AAMM,wCAHI,OAAO,iBAAiB,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAYjD;AASM,2KAFM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAY/C;mCAvDa,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,OAAO,CAAC;6BA7F1B,aAAa;iCAAb,aAAa"}
package/src/utils.js CHANGED
@@ -146,6 +146,7 @@ export const objectMapStoragePath = subscribers => {
146
146
  }
147
147
  return deeplyFulfilledObject(
148
148
  objectMap(subscribers, sub =>
149
+ // @ts-expect-error backwards compat
149
150
  'subscriber' in sub ? sub.storagePath : E(sub).getPath(),
150
151
  ),
151
152
  );