@agoric/client-utils 0.1.1-dev-5761f40.0 → 0.1.1-dev-b46dbaf.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 +2 -2
- package/src/marshalTables.d.ts.map +1 -1
- package/src/marshalTables.js +0 -2
- package/src/smart-wallet-kit.d.ts +2 -1
- package/src/smart-wallet-kit.d.ts.map +1 -1
- package/src/smart-wallet-kit.js +8 -2
- package/src/types.d.ts +4 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +4 -1
- package/src/wallet-utils.d.ts +2 -1
- package/src/wallet-utils.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/client-utils",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-b46dbaf.0+b46dbaf",
|
|
4
4
|
"description": "Utilities for building Agoric clients",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
],
|
|
63
63
|
"timeout": "20m"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "b46dbaf9410780dc148b0e66597cbdc65207fe35"
|
|
66
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marshalTables.d.ts","sourceRoot":"","sources":["marshalTables.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marshalTables.d.ts","sourceRoot":"","sources":["marshalTables.js"],"names":[],"mappings":"AA0EO,iDAFI,CAAC,CAAC,EAAE,OAAO,KAAK,MAAM;;;;;EAchC;;;;uBAxEa,MAAM,GAAG,IAAI"}
|
package/src/marshalTables.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
/**
|
|
3
2
|
* @file marshal tools for vstorage clients
|
|
4
3
|
*
|
|
@@ -56,7 +55,6 @@ const makeTranslationTable = (makeSlot, makeVal) => {
|
|
|
56
55
|
slotToVal.set(slot, val);
|
|
57
56
|
return val;
|
|
58
57
|
};
|
|
59
|
-
// eslint-disable-next-line no-undef
|
|
60
58
|
return harden({ convertValToSlot, convertSlotToVal });
|
|
61
59
|
};
|
|
62
60
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export function makeSmartWalletKit({ fetch, delay }: {
|
|
1
|
+
export function makeSmartWalletKit({ fetch, delay, names }: {
|
|
2
2
|
fetch: typeof globalThis.fetch;
|
|
3
3
|
delay: (ms: number) => Promise<void>;
|
|
4
|
+
names?: boolean | undefined;
|
|
4
5
|
}, networkConfig: MinimalNetworkConfig): Promise<{
|
|
5
6
|
agoricNames: import("@agoric/vats/tools/board-utils.js").AgoricNamesRemotes;
|
|
6
7
|
networkConfig: MinimalNetworkConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-wallet-kit.d.ts","sourceRoot":"","sources":["smart-wallet-kit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smart-wallet-kit.d.ts","sourceRoot":"","sources":["smart-wallet-kit.js"],"names":[],"mappings":"AAsBO,4DALJ;IAAuC,KAAK,EAApC,OAAO,UAAU,CAAC,KAAK;IACc,KAAK,EAA1C,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;IACb,KAAK;CAC7B,iBAAQ,oBAAoB;;;0BAyElB,MAAM,KACJ,OAAO,CAAC,YAAY,CAAC;mCAOvB,MAAM,KACJ,OAAO,CAAC,mBAAmB,CAAC;8BAnE9B,MAAM,cACN,MAAM,GAAC,MAAM;;;;;;;;;sBA0Bb,MAAM,MACN,MAAM,GAAC,MAAM,aACb,MAAM,GAAC,MAAM,2BACb,OAAO;;;;;;;;;;;;;;;;;;;;GAqDnB;6BACa,QAAQ,OAAO,kBAAkB,CAAC;0CA9GT,qBAAqB;kCADR,yCAAyC;yCAAzC,yCAAyC;2BAD7D,2BAA2B;4BAA3B,2BAA2B;6BADjC,WAAW"}
|
package/src/smart-wallet-kit.js
CHANGED
|
@@ -17,14 +17,20 @@ import { makeAgoricNames, makeVstorageKit } from './vstorage-kit.js';
|
|
|
17
17
|
* @param {object} root0
|
|
18
18
|
* @param {typeof globalThis.fetch} root0.fetch
|
|
19
19
|
* @param {(ms: number) => Promise<void>} root0.delay
|
|
20
|
+
* @param {boolean} [root0.names]
|
|
20
21
|
* @param {MinimalNetworkConfig} networkConfig
|
|
21
22
|
*/
|
|
22
|
-
export const makeSmartWalletKit = async (
|
|
23
|
+
export const makeSmartWalletKit = async (
|
|
24
|
+
{ fetch, delay, names = true },
|
|
25
|
+
networkConfig,
|
|
26
|
+
) => {
|
|
23
27
|
const vsk = makeVstorageKit({ fetch }, networkConfig);
|
|
24
28
|
|
|
25
29
|
const client = await makeStargateClient(networkConfig, { fetch });
|
|
26
30
|
|
|
27
|
-
const agoricNames = await
|
|
31
|
+
const agoricNames = await (names
|
|
32
|
+
? makeAgoricNames(vsk.fromBoard, vsk.vstorage)
|
|
33
|
+
: /** @type {import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes} */ ({}));
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* @param {string} from
|
package/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Brand } from '@agoric/ertp';
|
|
1
|
+
import type { Brand, Issuer } from '@agoric/ertp';
|
|
2
2
|
import type { ContractRecord, FeeConfig, PoolMetrics, TransactionRecord } from '@agoric/fast-usdc';
|
|
3
3
|
import type { OutcomeRecord, QuestionDetails } from '@agoric/governance/src/types.js';
|
|
4
4
|
import type { BookDataNotification } from '@agoric/inter-protocol/src/auction/auctionBook.js';
|
|
@@ -6,6 +6,7 @@ import type { AuctionParamRecord } from '@agoric/inter-protocol/src/auction/para
|
|
|
6
6
|
import type { ScheduleNotification } from '@agoric/inter-protocol/src/auction/scheduler.js';
|
|
7
7
|
import type { MetricsNotification as VaultDirectorMetrics } from '@agoric/inter-protocol/src/vaultFactory/vaultDirector.js';
|
|
8
8
|
import type { CurrentWalletRecord, UpdateRecord } from '@agoric/smart-wallet/src/smartWallet.js';
|
|
9
|
+
import type { AssetInfo } from '@agoric/vats/src/vat-bank.js';
|
|
9
10
|
import type { Instance } from '@agoric/zoe/src/zoeService/types.js';
|
|
10
11
|
type PublishedTypeMap = {
|
|
11
12
|
'auction.governance': {
|
|
@@ -15,6 +16,8 @@ type PublishedTypeMap = {
|
|
|
15
16
|
'vaultFactory.metrics': VaultDirectorMetrics;
|
|
16
17
|
'agoricNames.instance': Array<[string, Instance]>;
|
|
17
18
|
'agoricNames.brand': Array<[string, Brand]>;
|
|
19
|
+
'agoricNames.issuer': Array<[string, Issuer]>;
|
|
20
|
+
'agoricNames.vbankAsset': Array<[string, AssetInfo]>;
|
|
18
21
|
fastUsdc: ContractRecord;
|
|
19
22
|
'fastUsdc.feeConfig': FeeConfig;
|
|
20
23
|
'fastUsdc.poolMetrics': PoolMetrics;
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,WAAW,EACX,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OA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CAAgC,MAAM,UAAU,GACxD,oBAAoB,GACpB,CAAC,SAAS,iBAAiB,MAAM,EAAE,GACjC,iBAAiB,GACjB,CAAC,SAAS,eAAe,MAAM,EAAE,GAC/B,oBAAoB,GACpB,OAAO,CAAC"}
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @file types for the client-utils package
|
|
2
2
|
// NB: this doesn't follow best practices for TS in JS because this package will likely soon be written in TS
|
|
3
3
|
|
|
4
|
-
import type { Brand } from '@agoric/ertp';
|
|
4
|
+
import type { Brand, Issuer } from '@agoric/ertp';
|
|
5
5
|
import type {
|
|
6
6
|
ContractRecord,
|
|
7
7
|
FeeConfig,
|
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
CurrentWalletRecord,
|
|
21
21
|
UpdateRecord,
|
|
22
22
|
} from '@agoric/smart-wallet/src/smartWallet.js';
|
|
23
|
+
import type { AssetInfo } from '@agoric/vats/src/vat-bank.js';
|
|
23
24
|
import type { Instance } from '@agoric/zoe/src/zoeService/types.js';
|
|
24
25
|
|
|
25
26
|
// For static string key types. String template matching has to be in the ternary below.
|
|
@@ -29,6 +30,8 @@ type PublishedTypeMap = {
|
|
|
29
30
|
'vaultFactory.metrics': VaultDirectorMetrics;
|
|
30
31
|
'agoricNames.instance': Array<[string, Instance]>;
|
|
31
32
|
'agoricNames.brand': Array<[string, Brand]>;
|
|
33
|
+
'agoricNames.issuer': Array<[string, Issuer]>;
|
|
34
|
+
'agoricNames.vbankAsset': Array<[string, AssetInfo]>;
|
|
32
35
|
fastUsdc: ContractRecord;
|
|
33
36
|
'fastUsdc.feeConfig': FeeConfig;
|
|
34
37
|
'fastUsdc.poolMetrics': PoolMetrics;
|
package/src/wallet-utils.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @typedef {import('./smart-wallet-kit.js').SmartWalletKit} WalletUtils */
|
|
2
2
|
/** @deprecated use `makeSmartWalletKit` */
|
|
3
|
-
export const makeWalletUtils: ({ fetch, delay }: {
|
|
3
|
+
export const makeWalletUtils: ({ fetch, delay, names }: {
|
|
4
4
|
fetch: typeof globalThis.fetch;
|
|
5
5
|
delay: (ms: number) => Promise<void>;
|
|
6
|
+
names?: boolean | undefined;
|
|
6
7
|
}, networkConfig: import("./network-config.js").MinimalNetworkConfig) => Promise<{
|
|
7
8
|
agoricNames: import("@agoric/vats/tools/board-utils.js").AgoricNamesRemotes;
|
|
8
9
|
networkConfig: import("./network-config.js").MinimalNetworkConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-utils.d.ts","sourceRoot":"","sources":["wallet-utils.js"],"names":[],"mappings":"AAIA,6EAA6E;AAE7E,2CAA2C;AAC3C
|
|
1
|
+
{"version":3,"file":"wallet-utils.d.ts","sourceRoot":"","sources":["wallet-utils.js"],"names":[],"mappings":"AAIA,6EAA6E;AAE7E,2CAA2C;AAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAkD;0BAHpC,OAAO,uBAAuB,EAAE,cAAc"}
|