-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add fhenixsdk to hardhat * Add initializeWithHHSigner to fhenixsdk, start on tests * Add `fhenixsdk` tests * Update fhenix.js version * Improve overloaded class functions * Update api and naming * Update ethers version
- Loading branch information
1 parent
47f3239
commit b9eddb8
Showing
9 changed files
with
3,293 additions
and
2,528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,43 @@ | ||
import { FhenixClient } from "fhenixjs"; | ||
import { FhenixClient, fhenixsdk } from "fhenixjs"; | ||
import "hardhat/types/config"; | ||
import "hardhat/types/runtime"; | ||
|
||
import { FhenixHardhatRuntimeEnvironment } from "./FhenixHardhatRuntimeEnvironment"; | ||
import { InitParams } from "fhenixjs/lib/types/sdk/v2/sdk.store"; | ||
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; | ||
|
||
type PermitV2AccessRequirementsParams = | ||
| { | ||
contracts?: never[]; | ||
projects: string[]; | ||
} | ||
| { | ||
contracts: string[]; | ||
projects?: never[]; | ||
}; | ||
|
||
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; | ||
|
||
type FhenixsdkInitWithHHSignerParams = Expand< | ||
Omit<InitParams, "provider" | "signer" | "contracts" | "projects"> & { | ||
signer: SignerWithAddress; | ||
ignoreErrors?: boolean; | ||
} | ||
> & | ||
PermitV2AccessRequirementsParams; | ||
|
||
declare module "hardhat/types/runtime" { | ||
// Fhenix extension to the Hardhat Runtime Environment. | ||
// This new field will be available in tasks' actions, scripts, and tests. | ||
export interface HardhatRuntimeEnvironment { | ||
fhenixjs: FhenixClient & FhenixHardhatRuntimeEnvironment; | ||
fhenixsdk: typeof fhenixsdk & { | ||
/** | ||
* Initialize (or re-initialize) the fhenixsdk with an ethers hardhat SignerWithAddress | ||
*/ | ||
initializeWithHHSigner: ( | ||
params: FhenixsdkInitWithHHSignerParams, | ||
) => Promise<void>; | ||
}; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/fhenix-hardhat-plugin/test/fixture-projects/hardhat-project/hardhat.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.