Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: artifacts type & export #499

Merged
merged 2 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/smart-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"generate-types": "typechain --target=ethers-v5 --outDir=src/types 'build/contracts/*.json'"
},
"devDependencies": {
"@ethersproject/abi": "5.0.32",
"@openzeppelin/contracts": "2.5.1",
"@openzeppelin/test-helpers": "0.5.6",
"@requestnetwork/currency": "0.6.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/smart-contracts/src/lib/ContractArtifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Contract, ContractInterface, providers, Signer } from 'ethers';
import { Contract, providers, Signer } from 'ethers';
import { JsonFragment } from '@ethersproject/abi';

/**
* Contract information specific to a network
Expand All @@ -12,7 +13,7 @@ export type ArtifactNetworkInfo = {

/** Deployment information and ABI per network */
export type ArtifactDeploymentInfo<TNetwork extends string = string> = {
abi: ContractInterface;
abi: JsonFragment[];
deployment: Record<TNetwork, ArtifactNetworkInfo>;
};

Expand Down Expand Up @@ -48,7 +49,7 @@ export class ContractArtifact<TContract extends Contract> {
* Retrieve the abi from the artifact of the used version
* @returns the abi of the artifact as a json object
*/
getContractAbi(version = this.lastVersion): ContractInterface {
getContractAbi(version = this.lastVersion): JsonFragment[] {
return this.info[version].abi;
}

Expand Down
1 change: 1 addition & 0 deletions packages/smart-contracts/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './artifacts';
export * from './ContractArtifact';