Pick the ABI which you need just.
$ npm install --save-dev hardhat-abipick
# or
$ yarn add --dev hardhat-abipick
-
npx hardhat abipick [--format <format>]
: Pick the ABI which you need just.-
--format
parameter is the format of the output ABI, support 'json' 'minimal' 'full'
-
Load plugin in Hardhat config:
require('hardhat-abipick');
# or
import 'hardhat-abipick';
Add optional configuration with abipick
key:
option | description | optional | type | default value |
---|---|---|---|---|
format | output abi format, support 'json' 'minimal' 'full' | true | string | "json" |
contracts | the contracts you want to pick | true | object array | "[]" |
contracts[i].contract | the contract name | false | string | "[]" |
contracts[i].functions | the functions you want to pick | true | string array | "[]" |
contracts[i].events | the events you want to pick | true | string array | "[]" |
contracts[i].errors | the errors you want to pick | true | string array | "[]" |
!!
npx hardhat abipick [--format <format>]
command's--format
parameter has higher priority than configurationsformat
inhardhat.config.ts
.
for example:
abipick: {
format: "full", // "json" "minimal" "full"
contracts: [
{
contract: "ScoreLend",
functions: ["borrow"],
events: ["Borrow", "Payback"],
errors: ["HasOverdue"]
}
],
}
- v0.1.0 (2024/05/07)
- init release