Skip to content

Commit

Permalink
fix(pkg): update export
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Oct 17, 2024
1 parent b24c564 commit 97a224e
Show file tree
Hide file tree
Showing 495 changed files with 119,914 additions and 7 deletions.
5 changes: 3 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const config: HardhatUserConfig = {
},
viaIR: true,
},
}, {
},
{
version: "0.8.21",
settings: {
optimizer: {
Expand All @@ -70,7 +71,7 @@ const config: HardhatUserConfig = {
},
typechain: {
target: "ethers-v6",
outDir: "types/",
outDir: "pkg/types/",
externalArtifacts: ["deps/**/*.json"],
},
tracer: {
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"url": "https://github.com/morpho-labs/morpho-blue-bundlers/issues"
},
"homepage": "https://github.com/morpho-labs/morpho-blue-bundlers#readme",
"main": "dist/index.js",
"files": [
"dist"
],
"scripts": {
"prepare": "husky install && forge install",
"build:pkg": "yarn build:hardhat --force && tsc --build ./tsconfig.build.json",
Expand Down
4 changes: 2 additions & 2 deletions pkg/BundlerAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
EthereumPermitBundler__factory,
IAllowanceTransfer,
ERC20WrapperBundler__factory,
} from "../types";
import { AuthorizationStruct, MarketParamsStruct, WithdrawalStruct } from "../types/src/MorphoBundler";
} from "./types";
import { AuthorizationStruct, MarketParamsStruct, WithdrawalStruct } from "./types/src/MorphoBundler";

export type BundlerCall = string;

Expand Down
1 change: 1 addition & 0 deletions pkg/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { BundlerAction, BundlerCall } from "./BundlerAction";
export * from "./types";
131 changes: 131 additions & 0 deletions pkg/types/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
FunctionFragment,
Typed,
EventFragment,
ContractTransaction,
ContractTransactionResponse,
DeferredTopicFilter,
EventLog,
TransactionRequest,
LogDescription,
} from "ethers";

export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent>
extends DeferredTopicFilter {}

export interface TypedContractEvent<
InputTuple extends Array<any> = any,
OutputTuple extends Array<any> = any,
OutputObject = any
> {
(...args: Partial<InputTuple>): TypedDeferredTopicFilter<
TypedContractEvent<InputTuple, OutputTuple, OutputObject>
>;
name: string;
fragment: EventFragment;
getFragment(...args: Partial<InputTuple>): EventFragment;
}

type __TypechainAOutputTuple<T> = T extends TypedContractEvent<
infer _U,
infer W
>
? W
: never;
type __TypechainOutputObject<T> = T extends TypedContractEvent<
infer _U,
infer _W,
infer V
>
? V
: never;

export interface TypedEventLog<TCEvent extends TypedContractEvent>
extends Omit<EventLog, "args"> {
args: __TypechainAOutputTuple<TCEvent> & __TypechainOutputObject<TCEvent>;
}

export interface TypedLogDescription<TCEvent extends TypedContractEvent>
extends Omit<LogDescription, "args"> {
args: __TypechainAOutputTuple<TCEvent> & __TypechainOutputObject<TCEvent>;
}

export type TypedListener<TCEvent extends TypedContractEvent> = (
...listenerArg: [
...__TypechainAOutputTuple<TCEvent>,
TypedEventLog<TCEvent>,
...undefined[]
]
) => void;

export type MinEthersFactory<C, ARGS> = {
deploy(...a: ARGS[]): Promise<C>;
};

export type GetContractTypeFromFactory<F> = F extends MinEthersFactory<
infer C,
any
>
? C
: never;
export type GetARGsTypeFromFactory<F> = F extends MinEthersFactory<any, any>
? Parameters<F["deploy"]>
: never;

export type StateMutability = "nonpayable" | "payable" | "view";

export type BaseOverrides = Omit<TransactionRequest, "to" | "data">;
export type NonPayableOverrides = Omit<
BaseOverrides,
"value" | "blockTag" | "enableCcipRead"
>;
export type PayableOverrides = Omit<
BaseOverrides,
"blockTag" | "enableCcipRead"
>;
export type ViewOverrides = Omit<TransactionRequest, "to" | "data">;
export type Overrides<S extends StateMutability> = S extends "nonpayable"
? NonPayableOverrides
: S extends "payable"
? PayableOverrides
: ViewOverrides;

export type PostfixOverrides<A extends Array<any>, S extends StateMutability> =
| A
| [...A, Overrides<S>];
export type ContractMethodArgs<
A extends Array<any>,
S extends StateMutability
> = PostfixOverrides<{ [I in keyof A]-?: A[I] | Typed }, S>;

export type DefaultReturnType<R> = R extends Array<any> ? R[0] : R;

// export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> {
export interface TypedContractMethod<
A extends Array<any> = Array<any>,
R = any,
S extends StateMutability = "payable"
> {
(...args: ContractMethodArgs<A, S>): S extends "view"
? Promise<DefaultReturnType<R>>
: Promise<ContractTransactionResponse>;

name: string;

fragment: FunctionFragment;

getFragment(...args: ContractMethodArgs<A, S>): FunctionFragment;

populateTransaction(
...args: ContractMethodArgs<A, S>
): Promise<ContractTransaction>;
staticCall(
...args: ContractMethodArgs<A, "view">
): Promise<DefaultReturnType<R>>;
send(...args: ContractMethodArgs<A, S>): Promise<ContractTransactionResponse>;
estimateGas(...args: ContractMethodArgs<A, S>): Promise<bigint>;
staticCallResult(...args: ContractMethodArgs<A, "view">): Promise<R>;
}
6 changes: 6 additions & 0 deletions pkg/types/factories/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export * as lib from "./lib";
export * as solmate from "./solmate";
export * as src from "./src";
11 changes: 11 additions & 0 deletions pkg/types/factories/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export * as metamorpho from "./metamorpho";
export * as morphoBlue from "./morpho-blue";
export * as morphoBlueIrm from "./morpho-blue-irm";
export * as openzeppelinContracts from "./openzeppelin-contracts";
export * as permit2 from "./permit2";
export * as publicAllocator from "./public-allocator";
export * as solmate from "./solmate";
export * as universalRewardsDistributor from "./universal-rewards-distributor";
5 changes: 5 additions & 0 deletions pkg/types/factories/lib/metamorpho/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export * as lib from "./lib";
export * as src from "./src";
5 changes: 5 additions & 0 deletions pkg/types/factories/lib/metamorpho/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export * as morphoBlue from "./morpho-blue";
export * as openzeppelinContracts from "./openzeppelin-contracts";
4 changes: 4 additions & 0 deletions pkg/types/factories/lib/metamorpho/lib/morpho-blue/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export * as src from "./src";
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export * as interfaces from "./interfaces";
Loading

0 comments on commit 97a224e

Please sign in to comment.