@polymarbot/shared 0.4.0 → 0.4.1
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/index.cjs +1 -1
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/{loadEnv.cjs → load-env.cjs} +4 -4
- package/{loadEnv.js → load-env.js} +1 -1
- package/package.json +6 -6
- package/wallet.cjs +1 -4
- package/wallet.d.cts +9 -1
- package/wallet.d.ts +9 -1
- package/wallet.js +1 -4
- /package/{loadEnv.d.cts → load-env.d.cts} +0 -0
- /package/{loadEnv.d.ts → load-env.d.ts} +0 -0
package/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ module.exports = {
|
|
|
3
3
|
...require('./crypto.cjs'),
|
|
4
4
|
...require('./execution-queue/manager.cjs'),
|
|
5
5
|
...require('./hash.cjs'),
|
|
6
|
-
...require('./
|
|
6
|
+
...require('./load-env.cjs'),
|
|
7
7
|
...require('./markets/types.cjs'),
|
|
8
8
|
...require('./markets/utils.cjs'),
|
|
9
9
|
...require('./relayer-client.cjs'),
|
package/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './basic.js'
|
|
|
2
2
|
export * from './crypto.js'
|
|
3
3
|
export * from './execution-queue/manager.js'
|
|
4
4
|
export * from './hash.js'
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './load-env.js'
|
|
6
6
|
export * from './markets/types.js'
|
|
7
7
|
export * from './markets/utils.js'
|
|
8
8
|
export * from './relayer-client.js'
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './basic.js'
|
|
|
2
2
|
export * from './crypto.js'
|
|
3
3
|
export * from './execution-queue/manager.js'
|
|
4
4
|
export * from './hash.js'
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './load-env.js'
|
|
6
6
|
export * from './markets/types.js'
|
|
7
7
|
export * from './markets/utils.js'
|
|
8
8
|
export * from './relayer-client.js'
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export * from './basic.js'
|
|
|
2
2
|
export * from './crypto.js'
|
|
3
3
|
export * from './execution-queue/manager.js'
|
|
4
4
|
export * from './hash.js'
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './load-env.js'
|
|
6
6
|
export * from './markets/types.js'
|
|
7
7
|
export * from './markets/utils.js'
|
|
8
8
|
export * from './relayer-client.js'
|
|
@@ -17,12 +17,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/utils/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
20
|
+
// src/utils/load-env.ts
|
|
21
|
+
var load_env_exports = {};
|
|
22
|
+
__export(load_env_exports, {
|
|
23
23
|
loadEnv: () => loadEnv
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(load_env_exports);
|
|
26
26
|
var import_node_fs = require("fs");
|
|
27
27
|
var import_dotenv = require("dotenv");
|
|
28
28
|
function loadEnv(cwd = process.cwd(), extraPaths = []) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymarbot/shared",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"default": "./hash.cjs"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
"./
|
|
59
|
+
"./load-env": {
|
|
60
60
|
"import": {
|
|
61
|
-
"types": "./
|
|
62
|
-
"default": "./
|
|
61
|
+
"types": "./load-env.d.ts",
|
|
62
|
+
"default": "./load-env.js"
|
|
63
63
|
},
|
|
64
64
|
"require": {
|
|
65
|
-
"types": "./
|
|
66
|
-
"default": "./
|
|
65
|
+
"types": "./load-env.d.cts",
|
|
66
|
+
"default": "./load-env.cjs"
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"./markets/types": {
|
package/wallet.cjs
CHANGED
|
@@ -65,7 +65,7 @@ async function getUSDCBalancesBatch(addresses) {
|
|
|
65
65
|
return [];
|
|
66
66
|
}
|
|
67
67
|
const publicClient = getPublicClient();
|
|
68
|
-
|
|
68
|
+
return await publicClient.multicall({
|
|
69
69
|
contracts: addresses.map((address) => ({
|
|
70
70
|
address: USDC_ADDRESS,
|
|
71
71
|
abi: USDC_ABI,
|
|
@@ -74,9 +74,6 @@ async function getUSDCBalancesBatch(addresses) {
|
|
|
74
74
|
})),
|
|
75
75
|
allowFailure: true
|
|
76
76
|
});
|
|
77
|
-
return multicallResults.map(
|
|
78
|
-
(result) => result.status === "success" ? result.result : 0n
|
|
79
|
-
);
|
|
80
77
|
}
|
|
81
78
|
function isAddressEqual(a, b) {
|
|
82
79
|
if (!a) return false;
|
package/wallet.d.cts
CHANGED
|
@@ -20,7 +20,15 @@ declare function formatBalance(rawBalance: string | bigint, decimals?: number):
|
|
|
20
20
|
|
|
21
21
|
declare function getUSDCBalance(address: string): Promise<bigint>;
|
|
22
22
|
|
|
23
|
-
declare function getUSDCBalancesBatch(addresses: string[]): Promise<
|
|
23
|
+
declare function getUSDCBalancesBatch(addresses: string[]): Promise<({
|
|
24
|
+
error?: undefined;
|
|
25
|
+
result: bigint;
|
|
26
|
+
status: "success";
|
|
27
|
+
} | {
|
|
28
|
+
error: Error;
|
|
29
|
+
result?: undefined;
|
|
30
|
+
status: "failure";
|
|
31
|
+
})[]>;
|
|
24
32
|
|
|
25
33
|
declare function isAddressEqual(a?: Address | string | null, b?: Address | string | null): boolean;
|
|
26
34
|
|
package/wallet.d.ts
CHANGED
|
@@ -20,7 +20,15 @@ declare function formatBalance(rawBalance: string | bigint, decimals?: number):
|
|
|
20
20
|
|
|
21
21
|
declare function getUSDCBalance(address: string): Promise<bigint>;
|
|
22
22
|
|
|
23
|
-
declare function getUSDCBalancesBatch(addresses: string[]): Promise<
|
|
23
|
+
declare function getUSDCBalancesBatch(addresses: string[]): Promise<({
|
|
24
|
+
error?: undefined;
|
|
25
|
+
result: bigint;
|
|
26
|
+
status: "success";
|
|
27
|
+
} | {
|
|
28
|
+
error: Error;
|
|
29
|
+
result?: undefined;
|
|
30
|
+
status: "failure";
|
|
31
|
+
})[]>;
|
|
24
32
|
|
|
25
33
|
declare function isAddressEqual(a?: Address | string | null, b?: Address | string | null): boolean;
|
|
26
34
|
|
package/wallet.js
CHANGED
|
@@ -36,7 +36,7 @@ async function getUSDCBalancesBatch(addresses) {
|
|
|
36
36
|
return [];
|
|
37
37
|
}
|
|
38
38
|
const publicClient = getPublicClient();
|
|
39
|
-
|
|
39
|
+
return await publicClient.multicall({
|
|
40
40
|
contracts: addresses.map((address) => ({
|
|
41
41
|
address: USDC_ADDRESS,
|
|
42
42
|
abi: USDC_ABI,
|
|
@@ -45,9 +45,6 @@ async function getUSDCBalancesBatch(addresses) {
|
|
|
45
45
|
})),
|
|
46
46
|
allowFailure: true
|
|
47
47
|
});
|
|
48
|
-
return multicallResults.map(
|
|
49
|
-
(result) => result.status === "success" ? result.result : 0n
|
|
50
|
-
);
|
|
51
48
|
}
|
|
52
49
|
function isAddressEqual(a, b) {
|
|
53
50
|
if (!a) return false;
|
|
File without changes
|
|
File without changes
|