@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 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('./loadEnv.cjs'),
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 './loadEnv.js'
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 './loadEnv.js'
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 './loadEnv.js'
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/loadEnv.ts
21
- var loadEnv_exports = {};
22
- __export(loadEnv_exports, {
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(loadEnv_exports);
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 = []) {
@@ -1,6 +1,6 @@
1
1
  import "./chunk-JSBRDJBE.js";
2
2
 
3
- // src/utils/loadEnv.ts
3
+ // src/utils/load-env.ts
4
4
  import { existsSync } from "fs";
5
5
  import { config as dotenvConfig } from "dotenv";
6
6
  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.0",
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
- "./loadEnv": {
59
+ "./load-env": {
60
60
  "import": {
61
- "types": "./loadEnv.d.ts",
62
- "default": "./loadEnv.js"
61
+ "types": "./load-env.d.ts",
62
+ "default": "./load-env.js"
63
63
  },
64
64
  "require": {
65
- "types": "./loadEnv.d.cts",
66
- "default": "./loadEnv.cjs"
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
- const multicallResults = await publicClient.multicall({
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<bigint[]>;
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<bigint[]>;
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
- const multicallResults = await publicClient.multicall({
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