Skip to content

Latest commit

 

History

History
402 lines (243 loc) · 8.94 KB

CHANGELOG.md

File metadata and controls

402 lines (243 loc) · 8.94 KB

@gnosis-guild/typechain-ethers-v5

11.2.0

Minor Changes

  • 13d6426: feat: add support for typescript v5

11.1.3

Patch Changes

  • 083dea0: Fix clashes with built-in contract properties

11.1.2

Patch Changes

11.1.1

Patch Changes

11.1.0

Minor Changes

  • c4720b9: fix tuples in event signatures and also arrays of tuples in functions

Patch Changes

11.0.1

Patch Changes

11.0.0

Major Changes

  • 3eb6ed6: Removes PromiseOrValue

Minor Changes

  • 15541e4: Support for nodenext style import paths with new CLI flag: --node16-modules

Patch Changes

10.2.1

Patch Changes

  • 5b0759d: Remove obsolete peer dependency @ethersproject/bytes@^5.0.0 from target-ethers-v5
  • a036651: Fix for unused type in new ethers-v5 codegen

10.2.0

Minor Changes

  • 31e6957: Add const assertion for exported ABI

10.1.1

Patch Changes

10.1.0

Minor Changes

  • 015abb2: Added support for inputs wrapped in promise for ethers-v5 target.

Patch Changes

10.0.0

Major Changes

  • 3a8a99a: Directory tree in generated types now reflects the directory tree in the inputs. Also, only the main contract type is reexported from each file.

    This change solves a number of name clashing problems. All generated code can still be imported after updating the import path.

  • 978490f: ## What's breaking:

    We are not emitting contractName fields on contracts and factories anymore.

    Why?

    contractName breaks polymorphism for example: exact token implementation is not assignable to token interface.

    What do to?

    We are adding optional flag --discriminate-types to continue emitting contractName.

Minor Changes

  • d86d048: The method overloads for:

    getEvent
    getFunction
    decodeFunctionResult
    encodeFunctionData
    

    follow these rules:

    • If these entities are not overloaded in the contract ABI and --always-generate-overloads is off, just the entities' names are used (without the signature) • If the entities are overloaded, only signatures are used to disambiguate them • If --always-generate-overloads is on, additional overloads are generated for functions that are not ambiguous • For the method and event names in the events and functions properties only signature names are used (that's according to the ethers API - they don't use shorthand naming).

  • e447bfb: Added optional config.inputDir property and --input-dir flag to control directory structure in generated types. If not set, it's inferred as lowest common path of all ABI files.

  • a59ae6e: Prefer import type in generated files when possible

  • 47ab651: For every event, TypeChain now emits an interface with its named properties.

    Before

    export type ApprovalEvent = TypedEvent<
      [string, string, BigNumber],
      { owner: string; approved: string; tokenId: BigNumber }
    >

    After

    export interface ApprovalEventObject {
      owner: string
      approved: string
      tokenId: BigNumber
    }
    export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>

Patch Changes

  • 2395289: ContractFactory subclasses now use explicit "override" modifiers.

    TypeScript version 4.3 or newer is now required.

  • 975a9dc: Fix type generation for arrays of nested structs ex: GovernanceMessage.Call[][] calldata _remoteCalls.

    Fix structs parser in typechain package. Now only struct tuples are registered.

  • Updated dependencies [3a8a99a]

  • Updated dependencies [5b9a7fb]

  • Updated dependencies [e447bfb]

  • Updated dependencies [978490f]

  • Updated dependencies [a59ae6e]

  • Updated dependencies [975a9dc]

  • Updated dependencies [e1f832c]

9.0.0

Major Changes

  • 92939ea: Structs will be namespaced using contract name when available

Minor Changes

  • c2b7c3c: Added support descrimnated unions to contracts generated by typechain

Patch Changes

  • f22f962: Events with multiple positional parameters no longer get "undefined" as argument in contract.filters.

    dethcrypto#575

  • d244e41: Fix event name generation for events with arrays

  • Updated dependencies [92939ea]

  • Updated dependencies [d244e41]

8.0.5

Patch Changes

  • 8f7144c: Constant size with length greater than 4 no longer emit as TypeScript tuples.

8.0.4

Patch Changes

  • a26ea50: Constant size struct arrays are now properly supported and don't cause malformed TS emit anymore.
  • Updated dependencies [a26ea50]

8.0.3

Patch Changes

  • a0fba00: Ethers V5 target doesn't emit unused imports anymore.
  • Updated dependencies [a0fba00]

8.0.2

Patch Changes

  • ba4c18a: Fix support for constructors with structs

8.0.1

Patch Changes

  • b989dff: Fix structs generated as arrays

8.0.0

Major Changes

  • 5c217a6: Changed emitted event types — named events are now used in Contract methods.
  • 0e555af: Generate types to .ts files instead of .d.ts in Ethers v5 and Web3.js targets

Minor Changes

  • 95517e9: Add support for Solidity structs

    // before
    function deposit(amount: { token: string; value: BigNumberish }): Promise<ContractTransaction>
    
    // after
    export type AmountStruct = { token: string; value: BigNumberish }
    
    function deposit(amount: AmountStruct): Promise<ContractTransaction>

Patch Changes

  • a0b3c4b: Custom generated factories do not require signers now
  • aacdcb0: Export EventFilter type along with Event type
  • Updated dependencies [0ac4921]
  • Updated dependencies [95517e9]
  • Updated dependencies [33ee803]

7.2.0

Minor Changes

  • ed871ca: Fix contract interface functions name for tuples

Patch Changes

  • c93a1e7: Fixed generated contract factory constructors to accept 3 parameters when called from ContractFactory methods (this.constructor(interface, bytecode, signer)).

    Fixes dethcrypto#487

7.1.2

Patch Changes

  • e6bd016: Fix typing for getContractAt when using Hardhat

7.1.1

Patch Changes

  • 7f57ff8: Support typings for getContractAt when using Hardhat

7.1.0

Minor Changes

  • e4edd2c: Export typed events

7.0.1

Patch Changes

  • 46dcd66: Support nameless arguments in constructors

7.0.0

Minor Changes

  • 021e959: Expose ABI, bytecode, and contract interface in factories

Patch Changes

  • d590f88: Make filter parameters optional
  • bc4539a: Generated types now extend new BaseContract not Contract from ethers. This removes all index signatures and makes calling a non-existing function a compile-time error.
  • Updated dependencies [d60a343]
  • Updated dependencies [5a60d00]
  • Updated dependencies [d60a343]

6.0.5

Patch Changes

  • 833b7ea: Avoid generating reexports for duplicated contracts

6.0.4

Patch Changes

  • 743a600: Fix code generation for events with tuples

6.0.3

Patch Changes

  • 8528c8f: Allow passing from as part of the overrides to contract call
  • 5a1cb26: Prefer imports from ethers namespace to avoid mixing incompatible versions

6.0.2

Patch Changes

  • ffc67f2: Fix "unused type parameter" ts error

6.0.1

Patch Changes

  • 9ab1929: Fix code generation for events without any args

6.0.0

Major Changes

  • cd73777: Improve typings for events. Generate types for queryFilter for events.

    Note: This is a breaking change as it requires using TypeScript >= 4.0.0 (previously 3.9 was fine.)

    Example:

    const filter = contract.filters.Transfer() // TypedEventFilter<>
    const result = await contract.queryFilter(filter) // TypedEvent<>
    
    result[0].args.from // type support for named event parameters
    result[0].args[0] // type support by index
    
    contract.on(filter, (from, to, value, event) => {
      from // string
      to // string
      value // BigNumber
      event // TypedEvent<>
    })

5.0.0

Major Changes

  • 0d4b293: Changed return type of functions from a object with number indexes, to an array merged with object containing named outputs.

    Before, solidity function like this:

    function x() public pure returns (uint256)
    

    Generated such method signature:

    x(overrides?: CallOverrides): Promise<{0: BigNumber}>;

    New output is:

    x(overrides?: CallOverrides): Promise<[BigNumber]>;

    The difference is that now you can use standard array destructuring while working with output types.

Patch Changes

  • db5baa5: Do not generate typings in contract type itself for reserved keywords that would collide with ethers internals