@agoric/client-utils 0.2.0-upgrade-19-dev-0754752.0 → 0.2.0-upgrade-18a-dev-4ee0508.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 +13 -13
- package/src/smart-wallet-kit.js +1 -2
- package/src/types.d.ts +1 -10
- package/src/clock-timer.js +0 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/client-utils",
|
|
3
|
-
"version": "0.2.0-upgrade-
|
|
3
|
+
"version": "0.2.0-upgrade-18a-dev-4ee0508.0+4ee0508",
|
|
4
4
|
"description": "Utilities for building Agoric clients",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"ts-blank-space": "^0.4.4"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agoric/casting": "0.4.3-upgrade-
|
|
31
|
-
"@agoric/ertp": "0.16.3-upgrade-
|
|
32
|
-
"@agoric/internal": "0.4.0-upgrade-
|
|
33
|
-
"@agoric/smart-wallet": "0.5.4-upgrade-
|
|
34
|
-
"@agoric/vats": "0.16.0-upgrade-
|
|
30
|
+
"@agoric/casting": "0.4.3-upgrade-18a-dev-4ee0508.0+4ee0508",
|
|
31
|
+
"@agoric/ertp": "0.16.3-upgrade-18a-dev-4ee0508.0+4ee0508",
|
|
32
|
+
"@agoric/internal": "0.4.0-upgrade-18a-dev-4ee0508.0+4ee0508",
|
|
33
|
+
"@agoric/smart-wallet": "0.5.4-upgrade-18a-dev-4ee0508.0+4ee0508",
|
|
34
|
+
"@agoric/vats": "0.16.0-upgrade-18a-dev-4ee0508.0+4ee0508",
|
|
35
35
|
"@cosmjs/stargate": "^0.32.3",
|
|
36
36
|
"@cosmjs/tendermint-rpc": "^0.32.3",
|
|
37
|
-
"@endo/common": "^1.2.
|
|
38
|
-
"@endo/errors": "^1.2.
|
|
39
|
-
"@endo/marshal": "^1.6.
|
|
40
|
-
"@endo/pass-style": "^1.4.
|
|
41
|
-
"@endo/patterns": "^1.4.
|
|
42
|
-
"@endo/promise-kit": "^1.1.
|
|
37
|
+
"@endo/common": "^1.2.8",
|
|
38
|
+
"@endo/errors": "^1.2.8",
|
|
39
|
+
"@endo/marshal": "^1.6.2",
|
|
40
|
+
"@endo/pass-style": "^1.4.7",
|
|
41
|
+
"@endo/patterns": "^1.4.7",
|
|
42
|
+
"@endo/promise-kit": "^1.1.8"
|
|
43
43
|
},
|
|
44
44
|
"ava": {
|
|
45
45
|
"extensions": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
],
|
|
59
59
|
"timeout": "20m"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4ee05088e5ada989a866a11ff65838d395505ce6"
|
|
62
62
|
}
|
package/src/smart-wallet-kit.js
CHANGED
|
@@ -4,7 +4,6 @@ import { makeStargateClient } from './rpc.js';
|
|
|
4
4
|
import { makeAgoricNames, makeVstorageKit } from './vstorage-kit.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @import {EReturn} from '@endo/far';
|
|
8
7
|
* @import {Amount, Brand} from '@agoric/ertp/src/types.js'
|
|
9
8
|
* @import {CurrentWalletRecord, UpdateRecord} from '@agoric/smart-wallet/src/smartWallet.js';
|
|
10
9
|
* @import {MinimalNetworkConfig} from './network-config.js';
|
|
@@ -111,4 +110,4 @@ export const makeSmartWalletKit = async ({ fetch, delay }, networkConfig) => {
|
|
|
111
110
|
pollOffer,
|
|
112
111
|
};
|
|
113
112
|
};
|
|
114
|
-
/** @typedef {
|
|
113
|
+
/** @typedef {Awaited<ReturnType<typeof makeSmartWalletKit>>} SmartWalletKit */
|
package/src/types.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type {
|
|
|
10
10
|
CurrentWalletRecord,
|
|
11
11
|
UpdateRecord,
|
|
12
12
|
} from '@agoric/smart-wallet/src/smartWallet.js';
|
|
13
|
-
import type { ContractRecord, PoolMetrics } from '@agoric/fast-usdc';
|
|
14
13
|
|
|
15
14
|
// For static string key types. String template matching has to be in the ternary below.
|
|
16
15
|
type PublishedTypeMap = {
|
|
@@ -35,12 +34,4 @@ export type TypedPublished<T extends string> = T extends keyof PublishedTypeMap
|
|
|
35
34
|
? OutcomeRecord
|
|
36
35
|
: T extends `vaultFactory.managers.manager${number}.metrics`
|
|
37
36
|
? VaultManagerMetrics
|
|
38
|
-
:
|
|
39
|
-
? Array<[string, Instance]>
|
|
40
|
-
: T extends 'agoricNames.brand'
|
|
41
|
-
? Array<[string, Brand]>
|
|
42
|
-
: T extends 'fastUsdc'
|
|
43
|
-
? ContractRecord
|
|
44
|
-
: T extends 'fastUsdc.poolMetrics'
|
|
45
|
-
? PoolMetrics
|
|
46
|
-
: unknown;
|
|
37
|
+
: unknown;
|
package/src/clock-timer.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const { freeze } = Object;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {object} IntervalIO
|
|
5
|
-
* @property {typeof setTimeout} setTimeout
|
|
6
|
-
* @property {typeof clearTimeout} clearTimeout
|
|
7
|
-
* @property {typeof Date.now} now
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Creates an async iterable that emits values at specified intervals.
|
|
12
|
-
* @param {number} intervalMs - The interval duration in milliseconds.
|
|
13
|
-
* @param {IntervalIO} io
|
|
14
|
-
* @returns {{
|
|
15
|
-
* [Symbol.asyncIterator]: () => AsyncGenerator<number, void, void>
|
|
16
|
-
* }}
|
|
17
|
-
*/
|
|
18
|
-
export const makeIntervalIterable = (
|
|
19
|
-
intervalMs,
|
|
20
|
-
{ setTimeout, clearTimeout, now },
|
|
21
|
-
) => {
|
|
22
|
-
const self = freeze({
|
|
23
|
-
/**
|
|
24
|
-
* The async generator implementation.
|
|
25
|
-
* @returns {AsyncGenerator<number, void, void>}
|
|
26
|
-
*/
|
|
27
|
-
async *[Symbol.asyncIterator]() {
|
|
28
|
-
let timeoutId;
|
|
29
|
-
/** @type {undefined | ((x: number) => void) } */
|
|
30
|
-
let resolveNext;
|
|
31
|
-
|
|
32
|
-
await null;
|
|
33
|
-
try {
|
|
34
|
-
for (;;) {
|
|
35
|
-
timeoutId = setTimeout(() => {
|
|
36
|
-
// Promise.withResovers() would obviate this check
|
|
37
|
-
if (resolveNext) {
|
|
38
|
-
resolveNext(now());
|
|
39
|
-
}
|
|
40
|
-
}, intervalMs);
|
|
41
|
-
yield await new Promise(resolve => (resolveNext = resolve));
|
|
42
|
-
}
|
|
43
|
-
} finally {
|
|
44
|
-
// Ensure cleanup on completion
|
|
45
|
-
clearTimeout(timeoutId);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
return self;
|
|
50
|
-
};
|