@agoric/smart-wallet 0.5.4-dev-75b00b2.0 → 0.5.4-dev-bef63e5.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 +21 -21
- package/src/invitations.d.ts +1 -1
- package/src/invitations.d.ts.map +1 -1
- package/src/invitations.js +1 -1
- package/src/offers.d.ts +4 -4
- package/src/offers.d.ts.map +1 -1
- package/src/offers.js +3 -3
- package/src/smartWallet.d.ts +9 -9
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +4 -4
- package/src/utils.d.ts +9 -9
- package/src/utils.d.ts.map +1 -1
- package/src/utils.js +5 -5
- package/src/walletFactory.d.ts +63 -27
- package/src/walletFactory.d.ts.map +1 -1
- package/src/walletFactory.js +7 -7
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-bef63e5.0+bef63e5",
|
|
4
4
|
"description": "Wallet contract",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -16,29 +16,29 @@
|
|
|
16
16
|
"lint:eslint": "eslint ."
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@agoric/cosmic-proto": "0.3.1-dev-
|
|
20
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
21
|
-
"@endo/bundle-source": "^
|
|
22
|
-
"@endo/captp": "^
|
|
23
|
-
"@endo/init": "^0.
|
|
19
|
+
"@agoric/cosmic-proto": "0.3.1-dev-bef63e5.0+bef63e5",
|
|
20
|
+
"@agoric/swingset-vat": "0.32.3-dev-bef63e5.0+bef63e5",
|
|
21
|
+
"@endo/bundle-source": "^3.0.1",
|
|
22
|
+
"@endo/captp": "^4.0.1",
|
|
23
|
+
"@endo/init": "^1.0.1",
|
|
24
24
|
"ava": "^5.3.0",
|
|
25
25
|
"import-meta-resolve": "^2.2.1"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agoric/assert": "0.6.1-dev-
|
|
29
|
-
"@agoric/casting": "0.4.3-dev-
|
|
30
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
31
|
-
"@agoric/internal": "0.3.3-dev-
|
|
32
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
33
|
-
"@agoric/store": "0.9.3-dev-
|
|
34
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
35
|
-
"@agoric/vats": "0.15.2-dev-
|
|
36
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
37
|
-
"@endo/eventual-send": "^0.
|
|
38
|
-
"@endo/far": "^0.
|
|
39
|
-
"@endo/marshal": "^0.
|
|
40
|
-
"@endo/nat": "^
|
|
41
|
-
"@endo/promise-kit": "^0.
|
|
28
|
+
"@agoric/assert": "0.6.1-dev-bef63e5.0+bef63e5",
|
|
29
|
+
"@agoric/casting": "0.4.3-dev-bef63e5.0+bef63e5",
|
|
30
|
+
"@agoric/ertp": "0.16.3-dev-bef63e5.0+bef63e5",
|
|
31
|
+
"@agoric/internal": "0.3.3-dev-bef63e5.0+bef63e5",
|
|
32
|
+
"@agoric/notifier": "0.6.3-dev-bef63e5.0+bef63e5",
|
|
33
|
+
"@agoric/store": "0.9.3-dev-bef63e5.0+bef63e5",
|
|
34
|
+
"@agoric/vat-data": "0.5.3-dev-bef63e5.0+bef63e5",
|
|
35
|
+
"@agoric/vats": "0.15.2-dev-bef63e5.0+bef63e5",
|
|
36
|
+
"@agoric/zoe": "0.26.3-dev-bef63e5.0+bef63e5",
|
|
37
|
+
"@endo/eventual-send": "^1.0.1",
|
|
38
|
+
"@endo/far": "^1.0.1",
|
|
39
|
+
"@endo/marshal": "^1.0.1",
|
|
40
|
+
"@endo/nat": "^5.0.1",
|
|
41
|
+
"@endo/promise-kit": "^1.0.1"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"src/"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"typeCoverage": {
|
|
70
70
|
"atLeast": 86.97
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "bef63e5f0c6ad6a553b3eef69d722c060995a247"
|
|
73
73
|
}
|
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').InvitationMakers): (spec: InvitationSpec) => ERef<Invitation>;
|
|
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>;
|
|
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,KAAK,UAAU,CAAC,eAChB,KAAK,OAAO,cAAc,EAAE,OAAO,CAAC,mBACpC,MAAM,KAAK,CAAC,oBACZ,MAAM,KAAK,CAAC,2CACE,MAAM,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAkEO,2CANI,KAAK,UAAU,CAAC,eAChB,KAAK,OAAO,cAAc,EAAE,OAAO,CAAC,mBACpC,MAAM,KAAK,CAAC,oBACZ,MAAM,KAAK,CAAC,2CACE,MAAM,KAAK,OAAO,YAAY,EAAE,gBAAgB,UAsFrD,cAAc,KAAK,KAAK,UAAU,CAAC,CAgBtD;;;;6BAvJY,4BAA4B,GAAG,sBAAsB,GAAG,mBAAmB,GAAG,wBAAwB;;;;;;;2CAKtG;IACZ,MAAQ,EAAE,gBAAgB,CAAC;IAC3B,YAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAU,EAAE,MAAM,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,KAAK,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC"}
|
package/src/invitations.js
CHANGED
|
@@ -62,7 +62,7 @@ const MAX_PIPE_LENGTH = 2;
|
|
|
62
62
|
* @param {ERef<import('@agoric/vats').NameHub>} agoricNames
|
|
63
63
|
* @param {Brand<'set'>} invitationBrand
|
|
64
64
|
* @param {Purse<'set'>} invitationsPurse
|
|
65
|
-
* @param {(fromOfferId: string) => import('./types').InvitationMakers} getInvitationContinuation
|
|
65
|
+
* @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation
|
|
66
66
|
*/
|
|
67
67
|
export const makeInvitationsHelper = (
|
|
68
68
|
zoe,
|
package/src/offers.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {{
|
|
6
6
|
* id: OfferId,
|
|
7
|
-
* invitationSpec: import('./invitations').InvitationSpec,
|
|
7
|
+
* invitationSpec: import('./invitations.js').InvitationSpec,
|
|
8
8
|
* proposal: Proposal,
|
|
9
9
|
* offerArgs?: unknown
|
|
10
10
|
* }} OfferSpec
|
|
@@ -19,11 +19,11 @@ export function makeOfferExecutor({ zoe, depositFacet, invitationIssuer, powers,
|
|
|
19
19
|
invitationIssuer: ERef<Issuer<'set'>>;
|
|
20
20
|
powers: {
|
|
21
21
|
logger: Pick<Console, 'info' | 'error'>;
|
|
22
|
-
invitationFromSpec: (spec: import('./invitations').InvitationSpec) => ERef<Invitation>;
|
|
22
|
+
invitationFromSpec: (spec: import('./invitations.js').InvitationSpec) => ERef<Invitation>;
|
|
23
23
|
purseForBrand: (brand: Brand) => Promise<Purse>;
|
|
24
24
|
};
|
|
25
25
|
onStatusChange: (status: OfferStatus) => void;
|
|
26
|
-
onNewContinuingOffer: (offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').InvitationMakers, publicSubscribers: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord) => Promise<void>;
|
|
26
|
+
onNewContinuingOffer: (offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types.js').InvitationMakers, publicSubscribers: import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord) => Promise<void>;
|
|
27
27
|
}): {
|
|
28
28
|
/**
|
|
29
29
|
* Take an offer description provided in capData, augment it with payments and call zoe.offer()
|
|
@@ -38,7 +38,7 @@ export function makeOfferExecutor({ zoe, depositFacet, invitationIssuer, powers,
|
|
|
38
38
|
export type OfferId = number | string;
|
|
39
39
|
export type OfferSpec = {
|
|
40
40
|
id: OfferId;
|
|
41
|
-
invitationSpec: import('./invitations').InvitationSpec;
|
|
41
|
+
invitationSpec: import('./invitations.js').InvitationSpec;
|
|
42
42
|
proposal: Proposal;
|
|
43
43
|
offerArgs?: unknown;
|
|
44
44
|
};
|
package/src/offers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;AAwBzC;SAVI,KAAK,UAAU,CAAC;;mCACW,QAAQ,MAAM,CAAC;;sBAC1C,KAAK,OAAO,KAAK,CAAC,CAAC;;gBAEnB,KAAK,OAAO,EAAE,MAAM,GAAE,OAAO,CAAC;mCACvB,OAAO,
|
|
1
|
+
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;AAwBzC;SAVI,KAAK,UAAU,CAAC;;mCACW,QAAQ,MAAM,CAAC;;sBAC1C,KAAK,OAAO,KAAK,CAAC,CAAC;;gBAEnB,KAAK,OAAO,EAAE,MAAM,GAAE,OAAO,CAAC;mCACvB,OAAO,kBAAkB,EAAE,cAAc,KAAK,KAAK,UAAU,CAAC;+BAC7D,KAAK,KAAK,QAAQ,KAAK,CAAC;;6BACvB,WAAW,KAAK,IAAI;oCACnB,MAAM,oBAAoB,OAAO,KAAK,CAAC,oBAAoB,OAAO,YAAY,EAAE,gBAAgB,qBAAqB,OAAO,YAAY,EAAE,iBAAiB,GAAG,OAAO,0CAA0C,EAAE,YAAY,KAAM,QAAQ,IAAI,CAAC;;IAajQ;;;;;;;OAOG;4BAJQ,SAAS,2BACC,QAAQ,KAAK,IAAI,GACzB,QAAQ,IAAI,CAAC;EAwI7B;sBA7LY,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,OAAO,CAAA;CACpB;0BAOS,OAAO,aAAa,EAAE,SAAS,GAAG;IAC9C,KAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,MAAQ,CAAC,EAAE,OAAO,GAAG,yBAAyB,CAAC;IAC/C,OAAS,CAAC,EAAE,mBAAmB,CAAC;CAC7B"}
|
package/src/offers.js
CHANGED
|
@@ -9,7 +9,7 @@ import { makePaymentsHelper } from './payments.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {{
|
|
11
11
|
* id: OfferId,
|
|
12
|
-
* invitationSpec: import('./invitations').InvitationSpec,
|
|
12
|
+
* invitationSpec: import('./invitations.js').InvitationSpec,
|
|
13
13
|
* proposal: Proposal,
|
|
14
14
|
* offerArgs?: unknown
|
|
15
15
|
* }} OfferSpec
|
|
@@ -35,10 +35,10 @@ export const UNPUBLISHED_RESULT = 'UNPUBLISHED';
|
|
|
35
35
|
* @param {ERef<Issuer<'set'>>} opts.invitationIssuer
|
|
36
36
|
* @param {object} opts.powers
|
|
37
37
|
* @param {Pick<Console, 'info'| 'error'>} opts.powers.logger
|
|
38
|
-
* @param {(spec: import('./invitations').InvitationSpec) => ERef<Invitation>} opts.powers.invitationFromSpec
|
|
38
|
+
* @param {(spec: import('./invitations.js').InvitationSpec) => ERef<Invitation>} opts.powers.invitationFromSpec
|
|
39
39
|
* @param {(brand: Brand) => Promise<Purse>} opts.powers.purseForBrand
|
|
40
40
|
* @param {(status: OfferStatus) => void} opts.onStatusChange
|
|
41
|
-
* @param {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').InvitationMakers, publicSubscribers: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord ) => Promise<void>} opts.onNewContinuingOffer
|
|
41
|
+
* @param {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types.js').InvitationMakers, publicSubscribers: import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord ) => Promise<void>} opts.onNewContinuingOffer
|
|
42
42
|
*/
|
|
43
43
|
export const makeOfferExecutor = ({
|
|
44
44
|
zoe,
|
package/src/smartWallet.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BRAND_TO_PURSES_KEY: "brandToPurses";
|
|
2
2
|
export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage, shared: SharedParams): (uniqueWithoutChildNodes: Omit<UniqueParams, "currentStorageNode" | "walletStorageNode"> & {
|
|
3
3
|
walletStorageNode: ERef<StorageNode>;
|
|
4
|
-
}) => Promise<{
|
|
4
|
+
}) => Promise<import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
5
5
|
/**
|
|
6
6
|
* Umarshals the actionCapData and delegates to the appropriate action handler.
|
|
7
7
|
*
|
|
@@ -10,7 +10,7 @@ export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage,
|
|
|
10
10
|
* @returns {Promise<void>}
|
|
11
11
|
*/
|
|
12
12
|
handleBridgeAction(actionCapData: import('@endo/marshal').CapData<string>, canSpend?: boolean | undefined): Promise<void>;
|
|
13
|
-
getDepositFacet(): {
|
|
13
|
+
getDepositFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
14
14
|
/**
|
|
15
15
|
* Put the assets from the payment into the appropriate purse.
|
|
16
16
|
*
|
|
@@ -21,8 +21,8 @@ export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage,
|
|
|
21
21
|
* @throws if there's not yet a purse, though the payment is held to try again when there is
|
|
22
22
|
*/
|
|
23
23
|
receive(payment: Payment): Promise<Amount>;
|
|
24
|
-
}
|
|
25
|
-
getOffersFacet(): {
|
|
24
|
+
}>;
|
|
25
|
+
getOffersFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
26
26
|
/**
|
|
27
27
|
* Take an offer description provided in capData, augment it with payments and call zoe.offer()
|
|
28
28
|
*
|
|
@@ -39,7 +39,7 @@ export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage,
|
|
|
39
39
|
* @throws if the seat can't be found or E(seatRef).tryExit() fails.
|
|
40
40
|
*/
|
|
41
41
|
tryExitOffer(offerId: import('./offers.js').OfferId): Promise<void>;
|
|
42
|
-
}
|
|
42
|
+
}>;
|
|
43
43
|
/** @deprecated use getPublicTopics */
|
|
44
44
|
getCurrentSubscriber(): Subscriber<CurrentWalletRecord>;
|
|
45
45
|
/** @deprecated use getPublicTopics */
|
|
@@ -56,7 +56,7 @@ export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage,
|
|
|
56
56
|
storagePath: Promise<string>;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
}
|
|
59
|
+
}>>;
|
|
60
60
|
export type ExecuteOfferAction = {
|
|
61
61
|
method: 'executeOffer';
|
|
62
62
|
offer: import('./offers.js').OfferSpec;
|
|
@@ -124,11 +124,11 @@ export type BrandDescriptor = {
|
|
|
124
124
|
brand: Brand;
|
|
125
125
|
displayInfo: DisplayInfo;
|
|
126
126
|
issuer: Issuer;
|
|
127
|
-
petname: import('./types').Petname;
|
|
127
|
+
petname: import('./types.js').Petname;
|
|
128
128
|
};
|
|
129
129
|
export type UniqueParams = {
|
|
130
130
|
address: string;
|
|
131
|
-
bank: ERef<import('@agoric/vats/src/vat-bank').Bank>;
|
|
131
|
+
bank: ERef<import('@agoric/vats/src/vat-bank.js').Bank>;
|
|
132
132
|
currentStorageNode: StorageNode;
|
|
133
133
|
invitationPurse: Purse<'set'>;
|
|
134
134
|
walletStorageNode: StorageNode;
|
|
@@ -152,7 +152,7 @@ export type SharedParams = {
|
|
|
152
152
|
export type State = ImmutableState & MutableState;
|
|
153
153
|
export type ImmutableState = Readonly<UniqueParams & {
|
|
154
154
|
paymentQueues: MapStore<Brand, Array<Payment>>;
|
|
155
|
-
offerToInvitationMakers: MapStore<string, import('./types').InvitationMakers>;
|
|
155
|
+
offerToInvitationMakers: MapStore<string, import('./types.js').InvitationMakers>;
|
|
156
156
|
offerToPublicSubscriberPaths: MapStore<string, Record<string, string>>;
|
|
157
157
|
offerToUsedInvitation: MapStore<string, Amount>;
|
|
158
158
|
purseBalances: MapStore<Purse, Amount>;
|
package/src/smartWallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"AAgMA,kDAAmD;AAiB5C,4CAHI,OAAO,kBAAkB,EAAE,OAAO,UAClC,YAAY;uBAmiB2E,KAAK,WAAW,CAAC;;IA9F3G;;;;;;OAMG;sCAHQ,OAAO,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,mCAErC,QAAQ,IAAI,CAAC;;QApK1B;;;;;;;;WAQG;yBAHQ,OAAO,GACL,QAAQ,MAAM,CAAC;;;QAiC5B;;;;;;WAMG;gCAHQ,OAAO,aAAa,EAAE,SAAS,GAC7B,QAAQ,IAAI,CAAC;QAuG1B;;;;;;WAMG;8BAHQ,OAAO,aAAa,EAAE,OAAO,GAC3B,QAAQ,IAAI,CAAC;;IAmE1B,sCAAsC;;IAItC,sCAAsC;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"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"}
|
package/src/smartWallet.js
CHANGED
|
@@ -106,7 +106,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
106
106
|
* brand: Brand,
|
|
107
107
|
* displayInfo: DisplayInfo,
|
|
108
108
|
* issuer: Issuer,
|
|
109
|
-
* petname: import('./types').Petname
|
|
109
|
+
* petname: import('./types.js').Petname
|
|
110
110
|
* }} BrandDescriptor
|
|
111
111
|
* For use by clients to describe brands to users. Includes `displayInfo` to save a remote call.
|
|
112
112
|
*/
|
|
@@ -114,7 +114,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
114
114
|
/**
|
|
115
115
|
* @typedef {{
|
|
116
116
|
* address: string,
|
|
117
|
-
* bank: ERef<import('@agoric/vats/src/vat-bank').Bank>,
|
|
117
|
+
* bank: ERef<import('@agoric/vats/src/vat-bank.js').Bank>,
|
|
118
118
|
* currentStorageNode: StorageNode,
|
|
119
119
|
* invitationPurse: Purse<'set'>,
|
|
120
120
|
* walletStorageNode: StorageNode,
|
|
@@ -139,7 +139,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
139
139
|
*
|
|
140
140
|
* @typedef {Readonly<UniqueParams & {
|
|
141
141
|
* paymentQueues: MapStore<Brand, Array<Payment>>,
|
|
142
|
-
* offerToInvitationMakers: MapStore<string, import('./types').InvitationMakers>,
|
|
142
|
+
* offerToInvitationMakers: MapStore<string, import('./types.js').InvitationMakers>,
|
|
143
143
|
* offerToPublicSubscriberPaths: MapStore<string, Record<string, string>>,
|
|
144
144
|
* offerToUsedInvitation: MapStore<string, Amount>,
|
|
145
145
|
* purseBalances: MapStore<Purse, Amount>,
|
|
@@ -621,7 +621,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
},
|
|
624
|
-
/** @type {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').InvitationMakers, publicSubscribers?: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord) => Promise<void>} */
|
|
624
|
+
/** @type {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types.js').InvitationMakers, publicSubscribers?: import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord) => Promise<void>} */
|
|
625
625
|
onNewContinuingOffer: async (
|
|
626
626
|
offerId,
|
|
627
627
|
invitationAmount,
|
package/src/utils.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
export const NO_SMART_WALLET_ERROR: "no smart wallet";
|
|
2
2
|
export function makeWalletStateCoalescer(invitationBrand?: Brand<"set"> | undefined): {
|
|
3
3
|
state: {
|
|
4
|
-
invitationsReceived: Map<import("./offers").OfferId, {
|
|
5
|
-
acceptedIn: import('./offers').OfferId;
|
|
4
|
+
invitationsReceived: Map<import("./offers.js").OfferId, {
|
|
5
|
+
acceptedIn: import('./offers.js').OfferId;
|
|
6
6
|
description: string;
|
|
7
7
|
instance: Instance;
|
|
8
8
|
}>;
|
|
9
|
-
offerStatuses: Map<import("./offers").OfferId, import("./offers").OfferStatus>;
|
|
9
|
+
offerStatuses: Map<import("./offers.js").OfferId, import("./offers.js").OfferStatus>;
|
|
10
10
|
balances: Map<Brand<AssetKind>, Amount<AssetKind>>;
|
|
11
11
|
};
|
|
12
|
-
update: (updateRecord: import('./smartWallet').UpdateRecord | {}) => void;
|
|
12
|
+
update: (updateRecord: import('./smartWallet.js').UpdateRecord | {}) => void;
|
|
13
13
|
};
|
|
14
|
-
export function coalesceUpdates(updates: ERef<Subscriber<import('./smartWallet').UpdateRecord>>, invitationBrand?: Brand<"set"> | undefined): {
|
|
15
|
-
invitationsReceived: Map<import("./offers").OfferId, {
|
|
16
|
-
acceptedIn: import('./offers').OfferId;
|
|
14
|
+
export function coalesceUpdates(updates: ERef<Subscriber<import('./smartWallet.js').UpdateRecord>>, invitationBrand?: Brand<"set"> | undefined): {
|
|
15
|
+
invitationsReceived: Map<import("./offers.js").OfferId, {
|
|
16
|
+
acceptedIn: import('./offers.js').OfferId;
|
|
17
17
|
description: string;
|
|
18
18
|
instance: Instance;
|
|
19
19
|
}>;
|
|
20
|
-
offerStatuses: Map<import("./offers").OfferId, import("./offers").OfferStatus>;
|
|
20
|
+
offerStatuses: Map<import("./offers.js").OfferId, import("./offers.js").OfferStatus>;
|
|
21
21
|
balances: Map<Brand<AssetKind>, Amount<AssetKind>>;
|
|
22
22
|
};
|
|
23
23
|
export function assertHasData(follower: import('@agoric/casting').Follower<any>): Promise<void>;
|
|
24
|
-
export function objectMapStoragePath(subscribers?: import("@agoric/zoe/src/contractSupport").TopicsRecord | import("./types.js").PublicSubscribers | undefined): ERef<Record<string, string>> | null;
|
|
24
|
+
export function objectMapStoragePath(subscribers?: import("@agoric/zoe/src/contractSupport/topics.js").TopicsRecord | import("./types.js").PublicSubscribers | undefined): ERef<Record<string, string>> | null;
|
|
25
25
|
export type CoalescedWalletState = ReturnType<typeof makeWalletStateCoalescer>['state'];
|
|
26
26
|
//# sourceMappingURL=utils.d.ts.map
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAKA,sDAAuD;AAKhD;;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAKA,sDAAuD;AAKhD;;;wBASsD,OAAO,aAAa,EAAE,OAAO;yBAAe,MAAM;sBAAY,QAAQ;;;;;2BAIrH,OAAO,kBAAkB,EAAE,YAAY,GAAG,EAAE;EA8DzD;AAaM,yCAHI,KAAK,WAAW,OAAO,kBAAkB,EAAE,YAAY,CAAC,CAAC;;oBA5EP,OAAO,aAAa,EAAE,OAAO;qBAAe,MAAM;kBAAY,QAAQ;;;;EAwFlI;AAMM,wCAHI,OAAO,iBAAiB,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAYjD;AAQM,2KAFM,KAAK,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAW/C;mCArDa,WAAW,+BAA+B,CAAC,CAAC,OAAO,CAAC"}
|
package/src/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ const trace = makeTracer('WUTIL', false);
|
|
|
9
9
|
|
|
10
10
|
/** @param {Brand<'set'>} [invitationBrand] */
|
|
11
11
|
export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
|
|
12
|
-
/** @type {Map<import('./offers').OfferId, import('./offers').OfferStatus>} */
|
|
12
|
+
/** @type {Map<import('./offers.js').OfferId, import('./offers.js').OfferStatus>} */
|
|
13
13
|
const offerStatuses = new Map();
|
|
14
14
|
/** @type {Map<Brand, Amount>} */
|
|
15
15
|
const balances = new Map();
|
|
@@ -17,11 +17,11 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
|
|
|
17
17
|
/**
|
|
18
18
|
* keyed by description; xxx assumes unique
|
|
19
19
|
*
|
|
20
|
-
* @type {Map<import('./offers').OfferId, { acceptedIn: import('./offers').OfferId, description: string, instance: Instance }>}
|
|
20
|
+
* @type {Map<import('./offers.js').OfferId, { acceptedIn: import('./offers.js').OfferId, description: string, instance: Instance }>}
|
|
21
21
|
*/
|
|
22
22
|
const invitationsReceived = new Map();
|
|
23
23
|
|
|
24
|
-
/** @param {import('./smartWallet').UpdateRecord | {}} updateRecord newer than previous */
|
|
24
|
+
/** @param {import('./smartWallet.js').UpdateRecord | {}} updateRecord newer than previous */
|
|
25
25
|
const update = updateRecord => {
|
|
26
26
|
if (!('updated' in updateRecord)) {
|
|
27
27
|
return;
|
|
@@ -93,7 +93,7 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
|
|
|
93
93
|
* If this proves to be a problem we can add an option to this or a related
|
|
94
94
|
* utility to reset state from RPC.
|
|
95
95
|
*
|
|
96
|
-
* @param {ERef<Subscriber<import('./smartWallet').UpdateRecord>>} updates
|
|
96
|
+
* @param {ERef<Subscriber<import('./smartWallet.js').UpdateRecord>>} updates
|
|
97
97
|
* @param {Brand<'set'>} [invitationBrand]
|
|
98
98
|
*/
|
|
99
99
|
export const coalesceUpdates = (updates, invitationBrand) => {
|
|
@@ -125,7 +125,7 @@ export const assertHasData = async follower => {
|
|
|
125
125
|
/**
|
|
126
126
|
* Handles the case of falsy argument so the caller can consistently await.
|
|
127
127
|
*
|
|
128
|
-
* @param {import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord} [subscribers]
|
|
128
|
+
* @param {import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord} [subscribers]
|
|
129
129
|
* @returns {ERef<Record<string, string>> | null}
|
|
130
130
|
*/
|
|
131
131
|
export const objectMapStoragePath = subscribers => {
|
package/src/walletFactory.d.ts
CHANGED
|
@@ -13,13 +13,13 @@ export function makeAssetRegistry(assetPublisher: AssetPublisher): {
|
|
|
13
13
|
brand: Brand;
|
|
14
14
|
displayInfo: DisplayInfo;
|
|
15
15
|
issuer: Issuer;
|
|
16
|
-
petname: import('./types').Petname;
|
|
16
|
+
petname: import('./types.js').Petname;
|
|
17
17
|
};
|
|
18
18
|
values: () => Iterable<{
|
|
19
19
|
brand: Brand;
|
|
20
20
|
displayInfo: DisplayInfo;
|
|
21
21
|
issuer: Issuer;
|
|
22
|
-
petname: import('./types').Petname;
|
|
22
|
+
petname: import('./types.js').Petname;
|
|
23
23
|
}>;
|
|
24
24
|
};
|
|
25
25
|
export function prepare(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
|
|
@@ -27,24 +27,24 @@ export function prepare(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
|
|
|
27
27
|
walletBridgeManager?: ERef<import("@agoric/vats").ScopedBridgeManager> | undefined;
|
|
28
28
|
walletReviver?: ERef<WalletReviver> | undefined;
|
|
29
29
|
}, baggage: import('@agoric/vat-data').Baggage): Promise<{
|
|
30
|
-
creatorFacet: {
|
|
30
|
+
creatorFacet: import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
31
31
|
/**
|
|
32
32
|
* @param {string} address
|
|
33
|
-
* @param {ERef<import('@agoric/vats/src/vat-bank').Bank>} bank
|
|
34
|
-
* @param {ERef<import('@agoric/vats/').NameAdmin>} namesByAddressAdmin
|
|
35
|
-
* @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet
|
|
33
|
+
* @param {ERef<import('@agoric/vats/src/vat-bank.js').Bank>} bank
|
|
34
|
+
* @param {ERef<import('@agoric/vats/src/types.js').NameAdmin>} namesByAddressAdmin
|
|
35
|
+
* @returns {Promise<[wallet: import('./smartWallet.js').SmartWallet, isNew: boolean]>} wallet
|
|
36
36
|
* along with a flag to distinguish between looking up an existing wallet
|
|
37
37
|
* and creating a new one.
|
|
38
38
|
*/
|
|
39
|
-
provideSmartWallet(address: string, bank: ERef<import('@agoric/vats/src/vat-bank').Bank>, namesByAddressAdmin: ERef<import('@agoric/vats/').NameAdmin>): Promise<[wallet: {
|
|
39
|
+
provideSmartWallet(address: string, bank: ERef<import('@agoric/vats/src/vat-bank.js').Bank>, namesByAddressAdmin: ERef<import('@agoric/vats/src/types.js').NameAdmin>): Promise<[wallet: {
|
|
40
40
|
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string>, canSpend?: boolean | undefined): Promise<void>;
|
|
41
|
-
getDepositFacet(): {
|
|
41
|
+
getDepositFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
42
42
|
receive(payment: Payment<AssetKind>): Promise<Amount<AssetKind>>;
|
|
43
|
-
}
|
|
44
|
-
getOffersFacet(): {
|
|
43
|
+
}>;
|
|
44
|
+
getOffersFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
45
45
|
executeOffer(offerSpec: import("./offers.js").OfferSpec): Promise<void>;
|
|
46
46
|
tryExitOffer(offerId: import("./offers.js").OfferId): Promise<void>;
|
|
47
|
-
}
|
|
47
|
+
}>;
|
|
48
48
|
getCurrentSubscriber(): Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
|
|
49
49
|
getUpdatesSubscriber(): Subscriber<import("./smartWallet.js").UpdateRecord>;
|
|
50
50
|
getPublicTopics(): {
|
|
@@ -59,25 +59,61 @@ export function prepare(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
|
|
|
59
59
|
storagePath: Promise<string>;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
}
|
|
63
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
64
|
-
/**
|
|
65
|
-
* @param {string} address
|
|
66
|
-
* @param {ERef<import('@agoric/vats/src/vat-bank').Bank>} bank
|
|
67
|
-
* @param {ERef<import('@agoric/vats/').NameAdmin>} namesByAddressAdmin
|
|
68
|
-
* @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet
|
|
69
|
-
* along with a flag to distinguish between looking up an existing wallet
|
|
70
|
-
* and creating a new one.
|
|
71
|
-
*/
|
|
72
|
-
provideSmartWallet(address: string, bank: ERef<import('@agoric/vats/src/vat-bank').Bank>, namesByAddressAdmin: ERef<import('@agoric/vats/').NameAdmin>): Promise<[wallet: {
|
|
62
|
+
} & import("@endo/exo/src/get-interface.js").GetInterfaceGuard<{
|
|
73
63
|
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string>, canSpend?: boolean | undefined): Promise<void>;
|
|
74
|
-
getDepositFacet(): {
|
|
64
|
+
getDepositFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
75
65
|
receive(payment: Payment<AssetKind>): Promise<Amount<AssetKind>>;
|
|
66
|
+
}>;
|
|
67
|
+
getOffersFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
68
|
+
executeOffer(offerSpec: import("./offers.js").OfferSpec): Promise<void>;
|
|
69
|
+
tryExitOffer(offerId: import("./offers.js").OfferId): Promise<void>;
|
|
70
|
+
}>;
|
|
71
|
+
getCurrentSubscriber(): Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
|
|
72
|
+
getUpdatesSubscriber(): Subscriber<import("./smartWallet.js").UpdateRecord>;
|
|
73
|
+
getPublicTopics(): {
|
|
74
|
+
current: {
|
|
75
|
+
description: string;
|
|
76
|
+
subscriber: Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
|
|
77
|
+
storagePath: Promise<string>;
|
|
78
|
+
};
|
|
79
|
+
updates: {
|
|
80
|
+
description: string;
|
|
81
|
+
subscriber: Subscriber<import("./smartWallet.js").UpdateRecord>;
|
|
82
|
+
storagePath: Promise<string>;
|
|
83
|
+
};
|
|
76
84
|
};
|
|
77
|
-
|
|
85
|
+
}> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
86
|
+
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string>, canSpend?: boolean | undefined): Promise<void>;
|
|
87
|
+
getDepositFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
88
|
+
receive(payment: Payment<AssetKind>): Promise<Amount<AssetKind>>;
|
|
89
|
+
}>;
|
|
90
|
+
getOffersFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
78
91
|
executeOffer(offerSpec: import("./offers.js").OfferSpec): Promise<void>;
|
|
79
92
|
tryExitOffer(offerId: import("./offers.js").OfferId): Promise<void>;
|
|
93
|
+
}>;
|
|
94
|
+
getCurrentSubscriber(): Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
|
|
95
|
+
getUpdatesSubscriber(): Subscriber<import("./smartWallet.js").UpdateRecord>;
|
|
96
|
+
getPublicTopics(): {
|
|
97
|
+
current: {
|
|
98
|
+
description: string;
|
|
99
|
+
subscriber: Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
|
|
100
|
+
storagePath: Promise<string>;
|
|
101
|
+
};
|
|
102
|
+
updates: {
|
|
103
|
+
description: string;
|
|
104
|
+
subscriber: Subscriber<import("./smartWallet.js").UpdateRecord>;
|
|
105
|
+
storagePath: Promise<string>;
|
|
106
|
+
};
|
|
80
107
|
};
|
|
108
|
+
} & import("@endo/exo/src/get-interface.js").GetInterfaceGuard<{
|
|
109
|
+
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string>, canSpend?: boolean | undefined): Promise<void>;
|
|
110
|
+
getDepositFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
111
|
+
receive(payment: Payment<AssetKind>): Promise<Amount<AssetKind>>;
|
|
112
|
+
}>;
|
|
113
|
+
getOffersFacet(): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
114
|
+
executeOffer(offerSpec: import("./offers.js").OfferSpec): Promise<void>;
|
|
115
|
+
tryExitOffer(offerId: import("./offers.js").OfferId): Promise<void>;
|
|
116
|
+
}>;
|
|
81
117
|
getCurrentSubscriber(): Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
|
|
82
118
|
getUpdatesSubscriber(): Subscriber<import("./smartWallet.js").UpdateRecord>;
|
|
83
119
|
getPublicTopics(): {
|
|
@@ -92,7 +128,7 @@ export function prepare(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
|
|
|
92
128
|
storagePath: Promise<string>;
|
|
93
129
|
};
|
|
94
130
|
};
|
|
95
|
-
}
|
|
131
|
+
}>>, isNew: boolean]>;
|
|
96
132
|
}>;
|
|
97
133
|
}>;
|
|
98
134
|
export type SmartWalletContractTerms = {
|
|
@@ -102,11 +138,11 @@ export type SmartWalletContractTerms = {
|
|
|
102
138
|
};
|
|
103
139
|
export type NameHub = import('@agoric/vats').NameHub;
|
|
104
140
|
export type AssetPublisher = {
|
|
105
|
-
getAssetSubscription: () => ERef<IterableEachTopic<import('@agoric/vats/src/vat-bank').AssetDescriptor>>;
|
|
141
|
+
getAssetSubscription: () => ERef<IterableEachTopic<import('@agoric/vats/src/vat-bank.js').AssetDescriptor>>;
|
|
106
142
|
};
|
|
107
143
|
export type isRevive = boolean;
|
|
108
144
|
export type WalletReviver = {
|
|
109
|
-
reviveWallet: (address: string) => Promise<import('./smartWallet').SmartWallet>;
|
|
145
|
+
reviveWallet: (address: string) => Promise<import('./smartWallet.js').SmartWallet>;
|
|
110
146
|
ackWallet: (address: string) => isRevive;
|
|
111
147
|
};
|
|
112
148
|
export type start = typeof prepare;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AAwBA,gEAKE;AAUK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAwCrB,2BAA2B;iBAAf,KAAK;IAEjB,2BAA2B;iBAAf,KAAK;eApCP,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,
|
|
1
|
+
{"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AAwBA,gEAKE;AAUK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAwCrB,2BAA2B;iBAAf,KAAK;IAEjB,2BAA2B;iBAAf,KAAK;eApCP,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,YAAY,EAAE,OAAO;;;eAH9B,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,YAAY,EAAE,OAAO;;EAsC3C;AAmCM,6BARI,IAAI,wBAAwB,CAAC;iBAEtB,KAAK,WAAW,CAAC;;;YAIxB,OAAO,kBAAkB,EAAE,OAAO;;QA6GvC;;;;;;;WAOG;oCANQ,MAAM,QACN,KAAK,OAAO,8BAA8B,EAAE,IAAI,CAAC,uBACjD,KAAK,OAAO,2BAA2B,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDnE;uCAlMY;IACZ,WAAe,EAAE,KAAK,OAAO,CAAC,CAAC;IAC/B,KAAS,EAAE,KAAK,OAAO,cAAc,EAAE,KAAK,CAAC,CAAC;IAC9C,cAAkB,EAAE,cAAc,CAAC;CAChC;sBAES,OAAO,cAAc,EAAE,OAAO;6BAE9B;IACZ,oBAAwB,EAAE,MAAM,KAChC,kBAAwB,OAAO,8BAA8B,EAAE,eAAe,CAAC,CAAC,CAAA;CAC7E;uBAES,OAAO;;4BAES,MAAM,KAAK,QAAQ,OAAO,kBAAkB,EAAE,WAAW,CAAC;yBAC7D,MAAM,KAAK,QAAQ;;oBAuL/B,cAAc"}
|
package/src/walletFactory.js
CHANGED
|
@@ -68,7 +68,7 @@ export const makeAssetRegistry = assetPublisher => {
|
|
|
68
68
|
* brand: Brand,
|
|
69
69
|
* displayInfo: DisplayInfo,
|
|
70
70
|
* issuer: Issuer,
|
|
71
|
-
* petname: import('./types').Petname
|
|
71
|
+
* petname: import('./types.js').Petname
|
|
72
72
|
* }} BrandDescriptor
|
|
73
73
|
* For use by clients to describe brands to users. Includes `displayInfo` to save a remote call.
|
|
74
74
|
*/
|
|
@@ -119,12 +119,12 @@ export const makeAssetRegistry = assetPublisher => {
|
|
|
119
119
|
*
|
|
120
120
|
* @typedef {{
|
|
121
121
|
* getAssetSubscription: () => ERef<
|
|
122
|
-
* IterableEachTopic<import('@agoric/vats/src/vat-bank').AssetDescriptor>>
|
|
122
|
+
* IterableEachTopic<import('@agoric/vats/src/vat-bank.js').AssetDescriptor>>
|
|
123
123
|
* }} AssetPublisher
|
|
124
124
|
*
|
|
125
125
|
* @typedef {boolean} isRevive
|
|
126
126
|
* @typedef {{
|
|
127
|
-
* reviveWallet: (address: string) => Promise<import('./smartWallet').SmartWallet>,
|
|
127
|
+
* reviveWallet: (address: string) => Promise<import('./smartWallet.js').SmartWallet>,
|
|
128
128
|
* ackWallet: (address: string) => isRevive,
|
|
129
129
|
* }} WalletReviver
|
|
130
130
|
*/
|
|
@@ -250,16 +250,16 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
250
250
|
{
|
|
251
251
|
/**
|
|
252
252
|
* @param {string} address
|
|
253
|
-
* @param {ERef<import('@agoric/vats/src/vat-bank').Bank>} bank
|
|
254
|
-
* @param {ERef<import('@agoric/vats/').NameAdmin>} namesByAddressAdmin
|
|
255
|
-
* @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet
|
|
253
|
+
* @param {ERef<import('@agoric/vats/src/vat-bank.js').Bank>} bank
|
|
254
|
+
* @param {ERef<import('@agoric/vats/src/types.js').NameAdmin>} namesByAddressAdmin
|
|
255
|
+
* @returns {Promise<[wallet: import('./smartWallet.js').SmartWallet, isNew: boolean]>} wallet
|
|
256
256
|
* along with a flag to distinguish between looking up an existing wallet
|
|
257
257
|
* and creating a new one.
|
|
258
258
|
*/
|
|
259
259
|
provideSmartWallet(address, bank, namesByAddressAdmin) {
|
|
260
260
|
let isNew = false;
|
|
261
261
|
|
|
262
|
-
/** @type {(address: string) => Promise<import('./smartWallet').SmartWallet>} */
|
|
262
|
+
/** @type {(address: string) => Promise<import('./smartWallet.js').SmartWallet>} */
|
|
263
263
|
const maker = async _address => {
|
|
264
264
|
const invitationPurse = await E(invitationIssuer).makeEmptyPurse();
|
|
265
265
|
const walletStorageNode = E(storageNode).makeChildNode(address);
|