@woof-software/contracts-tools-sdk-ethers 0.0.3 → 0.0.5

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/lib/config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_LOGS_BLOCKS_STEP, DEFAULT_LOGS_DELAY_MS, DEFAULT_MULTICALL_ALLOW_FAILURE, DEFAULT_MULTICALL_BATCH_DELAY_MS, DEFAULT_MULTICALL_MUTABLE_CALLS_BATCH_LIMIT, DEFAULT_MULTICALL_STATIC_CALLS_BATCH_LIMIT, DEFAULT_MULTICALL_WAIT_FOR_TXS, DEFAULT_MUTABLE_CALLS_TIMEOUT_MS, DEFAULT_PRIORITY_CALL_MULTIPLIER, DEFAULT_STATIC_CALLS_TIMEOUT_MS, DEFAULT_WAIT_CALLS_TIMEOUT_MS, MULTICALL_ADDRESS, } from "./constant";
1
+ import { DEFAULT_LOGS_BLOCKS_STEP, DEFAULT_LOGS_DELAY_MS, DEFAULT_MULTICALL_ALLOW_FAILURE, DEFAULT_MULTICALL_BATCH_DELAY_MS, DEFAULT_MULTICALL_MUTABLE_CALLS_BATCH_LIMIT, DEFAULT_MULTICALL_STATIC_CALLS_BATCH_LIMIT, DEFAULT_MULTICALL_WAIT_FOR_TXS, DEFAULT_MUTABLE_CALLS_TIMEOUT_MS, DEFAULT_PRIORITY_CALL_MULTIPLIER, DEFAULT_STATIC_CALLS_TIMEOUT_MS, DEFAULT_WAIT_CALLS_TIMEOUT_MS, MULTICALL_ADDRESS, } from "./constant.js";
2
2
  export const config = {
3
3
  multicallUnit: {
4
4
  address: MULTICALL_ADDRESS,
@@ -1,10 +1,10 @@
1
1
  import { Contract as EthersContract, Wallet, WebSocketProvider, } from "ethers";
2
- import { config } from "../config";
3
- import { CONTRACTS_ERRORS } from "../errors";
4
- import { isSigner, isStaticMethod } from "../helpers";
5
- import { CallMutability, } from "../types";
6
- import { checkSignals, createTimeoutSignal, priorityCall, raceWithSignals, waitWithSignals, } from "../utils";
7
- import { contractCreateCallName } from "./contract-create-call-name";
2
+ import { config } from "../config.js";
3
+ import { CONTRACTS_ERRORS } from "../errors/index.js";
4
+ import { isSigner, isStaticMethod } from "../helpers/index.js";
5
+ import { CallMutability, } from "../types/index.js";
6
+ import { checkSignals, createTimeoutSignal, priorityCall, raceWithSignals, waitWithSignals, } from "../utils/index.js";
7
+ import { contractCreateCallName } from "./contract-create-call-name.js";
8
8
  export class BaseContract {
9
9
  static createAutoClass(abi, address, driver, options) {
10
10
  return class extends this {
@@ -1 +1 @@
1
- export * from "./base-contract";
1
+ export * from "./base-contract.js";
@@ -1,2 +1,2 @@
1
- export * from "./multicall-errors";
2
- export * from "./contracts-errors";
1
+ export * from "./multicall-errors.js";
2
+ export * from "./contracts-errors.js";
@@ -1,6 +1,6 @@
1
- export * from "./is-static-array";
2
- export * from "./is-static-method";
3
- export * from "./wait-for-address-txs";
4
- export * from "./is-signer";
5
- export * from "./is-parsable";
6
- export * from "./priority-call";
1
+ export * from "./is-static-array.js";
2
+ export * from "./is-static-method.js";
3
+ export * from "./wait-for-address-txs.js";
4
+ export * from "./is-signer.js";
5
+ export * from "./is-parsable.js";
6
+ export * from "./priority-call.js";
@@ -1,2 +1,2 @@
1
- import { isStaticMethod } from "./is-static-method";
1
+ import { isStaticMethod } from "./is-static-method.js";
2
2
  export const isStaticArray = (calls) => !calls.some((call) => !isStaticMethod(call.stateMutability));
@@ -1,4 +1,4 @@
1
- import { StateMutability } from "../types";
1
+ import { StateMutability } from "../types/index.js";
2
2
  export const isStaticMethod = (state) => {
3
3
  return state === StateMutability.View || state === StateMutability.Pure;
4
4
  };
@@ -1,5 +1,5 @@
1
- import { DEFAULT_PRIORITY_CALL_MULTIPLIER } from "../constant";
2
- import { checkSignals, createTimeoutSignal } from "../utils";
1
+ import { DEFAULT_PRIORITY_CALL_MULTIPLIER } from "../constant.js";
2
+ import { checkSignals, createTimeoutSignal } from "../utils/index.js";
3
3
  export async function priorityCall(provider, signer, contract, method, args = [], options = {}) {
4
4
  const localOptions = {
5
5
  multiplier: DEFAULT_PRIORITY_CALL_MULTIPLIER,
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./contract";
2
- export * from "./multicall";
3
- export * from "./config";
4
- export * from "./helpers";
5
- export * from "./types";
1
+ export * from "./contract/index.js";
2
+ export * from "./multicall/index.js";
3
+ export * from "./config.js";
4
+ export * from "./helpers/index.js";
5
+ export * from "./types/index.js";
@@ -1,5 +1,5 @@
1
- export * from "./multicall-normalize-tags";
2
- export * from "./multicall-split-calls";
3
- export * from "./multicall-unit";
4
- export * from "./multicall-normalize-tags";
5
- export * from "./multicall-split-calls";
1
+ export * from "./multicall-normalize-tags.js";
2
+ export * from "./multicall-split-calls.js";
3
+ export * from "./multicall-unit.js";
4
+ export * from "./multicall-normalize-tags.js";
5
+ export * from "./multicall-split-calls.js";
@@ -1,4 +1,4 @@
1
- import { isStaticMethod } from "../helpers";
1
+ import { isStaticMethod } from "../helpers/index.js";
2
2
  export const multicallSplitCalls = (calls, tags) => calls.reduce((acc, call, index) => {
3
3
  if (isStaticMethod(call.stateMutability)) {
4
4
  acc.staticCalls.push(call);
@@ -1,16 +1,16 @@
1
1
  import { EventEmitter } from "node:events";
2
- import { MulticallAbi } from "../abis";
3
- import { config } from "../config";
4
- import { MULTICALL_ADDRESS } from "../constant";
5
- import { BaseContract } from "../contract";
6
- import { MULTICALL_ERRORS } from "../errors";
7
- import { isParsable, isStaticArray } from "../helpers";
8
- import { CallMutability, } from "../types";
9
- import { checkSignals, createTimeoutSignal, raceWithSignals, waitWithSignals, } from "../utils";
10
- import { multicallErrorEventName } from "./multicall-error-event-name";
11
- import { multicallNormalizeTags } from "./multicall-normalize-tags";
12
- import { multicallResultEventName } from "./multicall-result-event-name";
13
- import { multicallSplitCalls } from "./multicall-split-calls";
2
+ import { MulticallAbi } from "../abis/index.js";
3
+ import { config } from "../config.js";
4
+ import { MULTICALL_ADDRESS } from "../constant.js";
5
+ import { BaseContract } from "../contract/index.js";
6
+ import { MULTICALL_ERRORS } from "../errors/index.js";
7
+ import { isParsable, isStaticArray } from "../helpers/index.js";
8
+ import { CallMutability, } from "../types/index.js";
9
+ import { checkSignals, createTimeoutSignal, raceWithSignals, waitWithSignals, } from "../utils/index.js";
10
+ import { multicallErrorEventName } from "./multicall-error-event-name.js";
11
+ import { multicallNormalizeTags } from "./multicall-normalize-tags.js";
12
+ import { multicallResultEventName } from "./multicall-result-event-name.js";
13
+ import { multicallSplitCalls } from "./multicall-split-calls.js";
14
14
  const aggregate3 = "aggregate3";
15
15
  export class MulticallUnit extends BaseContract {
16
16
  constructor(driver, options = {}, multicallAddress = MULTICALL_ADDRESS) {
@@ -1,6 +1,6 @@
1
- export * from "./contract-call";
2
- export * from "./contract-call-options";
3
- export * from "./contract-get-logs-options";
4
- export * from "./contract-options";
5
- export * from "./dynamic-contract";
6
- export * from "./dynamic-contract-constructor";
1
+ export * from "./contract-call.js";
2
+ export * from "./contract-call-options.js";
3
+ export * from "./contract-get-logs-options.js";
4
+ export * from "./contract-options.js";
5
+ export * from "./dynamic-contract.js";
6
+ export * from "./dynamic-contract-constructor.js";
@@ -1,6 +1,6 @@
1
- export * from "./contract";
2
- export * from "./multicall";
3
- export * from "./split-calls";
4
- export * from "./state-mutabiity";
5
- export * from "./call-mutability";
6
- export * from "./priority-call-options";
1
+ export * from "./contract/index.js";
2
+ export * from "./multicall/index.js";
3
+ export * from "./split-calls.js";
4
+ export * from "./state-mutabiity.js";
5
+ export * from "./call-mutability.js";
6
+ export * from "./priority-call-options.js";
@@ -1,5 +1,5 @@
1
- export * from "./multicall-tags";
2
- export * from "./multicall-response";
3
- export * from "./multicall-options";
4
- export * from "./multicall-decodable-data";
5
- export * from "./multicall-wait-options";
1
+ export * from "./multicall-tags.js";
2
+ export * from "./multicall-response.js";
3
+ export * from "./multicall-options.js";
4
+ export * from "./multicall-decodable-data.js";
5
+ export * from "./multicall-wait-options.js";
@@ -1,6 +1,6 @@
1
- export * from "./create-timeout-signal";
2
- export * from "./race-with-signals";
3
- export * from "./create-signals-promise";
4
- export * from "../helpers/priority-call";
5
- export * from "./check-signals";
6
- export * from "./wait-with-signals";
1
+ export * from "./create-timeout-signal.js";
2
+ export * from "./race-with-signals.js";
3
+ export * from "./create-signals-promise.js";
4
+ export * from "../helpers/priority-call.js";
5
+ export * from "./check-signals.js";
6
+ export * from "./wait-with-signals.js";
@@ -1,4 +1,4 @@
1
- import { createSignalsPromise } from "./create-signals-promise";
1
+ import { createSignalsPromise } from "./create-signals-promise.js";
2
2
  export async function raceWithSignals(racer, signals = []) {
3
3
  for (const signal of signals) {
4
4
  if (signal.aborted) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@woof-software/contracts-tools-sdk-ethers",
3
3
  "description": "Module simplify smart contract interactions and multicall3 aggregation on the Ethereum blockchain and other EVM-compatible networks.",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/woof-compound/sandbox-sdks.git"
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "scripts": {
35
35
  "prepublish": "$npm_execpath build",
36
- "build": "tsc --build tsconfig.build.json",
36
+ "build": "tsc --build tsconfig.build.json --force && node ../../scripts/compile/post-compile.js",
37
37
  "test": "vitest run --coverage --config test/vitest-config/vitest.config.unit.ts",
38
38
  "test:unit": "vitest run --coverage --config test/vitest-config/vitest.config.unit.ts",
39
39
  "test:e2e": "vitest run --coverage --config test/vitest-config/vitest.config.e2e.ts",