Socket
Socket
Sign inDemoInstall

@nomicfoundation/ignition-core

Package Overview
Dependencies
39
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.12.0 to 0.13.0

10

CHANGELOG.md

@@ -7,2 +7,12 @@ # Changelog

## 0.13.0 - 2023-12-13
### Added
- Enhance types around artifacts and ABIs to better support `Viem` type inference ([#612](https://github.com/NomicFoundation/hardhat-ignition/pull/612))
### Fixed
- Fix bug with default sender account not being recognised due to case sensitivity ([#640](https://github.com/NomicFoundation/hardhat-ignition/pull/640))
## 0.12.0 - 2023-12-05

@@ -9,0 +19,0 @@

31

dist/ignition-core.d.ts
/**
* The type of the contract artifact's ABI.
*
* @beta
*/
export declare type Abi = readonly any[] | any[];
/**
* A local account.

@@ -53,7 +60,7 @@ *

*/
export declare interface Artifact {
export declare interface Artifact<AbiT extends Abi = Abi> {
contractName: string;
sourceName: string;
bytecode: string;
abi: any[];
abi: AbiT;
linkReferences: Record<string, Record<string, Array<{

@@ -352,3 +359,3 @@ length: number;

*/
export declare interface ContractAtFuture {
export declare interface ContractAtFuture<AbiT extends Abi = Abi> {
type: FutureType.CONTRACT_AT;

@@ -360,3 +367,3 @@ id: string;

address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>;
artifact: Artifact;
artifact: Artifact<AbiT>;
}

@@ -397,3 +404,3 @@

*/
export declare interface ContractDeploymentFuture {
export declare interface ContractDeploymentFuture<AbiT extends Abi = Abi> {
type: FutureType.CONTRACT_DEPLOYMENT;

@@ -404,3 +411,3 @@ id: string;

contractName: string;
artifact: Artifact;
artifact: Artifact<AbiT>;
constructorArgs: ArgumentType[];

@@ -448,3 +455,3 @@ libraries: Record<string, ContractFuture<string>>;

*/
export declare function deploy<ModuleIdT extends string, ContractNameT extends string, IgnitionModuleResultsT extends IgnitionModuleResult<ContractNameT>>({ config, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender, }: {
export declare function deploy<ModuleIdT extends string, ContractNameT extends string, IgnitionModuleResultsT extends IgnitionModuleResult<ContractNameT>>({ config, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, }: {
config?: Partial<DeployConfig>;

@@ -911,9 +918,9 @@ artifactResolver: ArtifactResolver;

contract<ContractNameT extends string>(contractName: ContractNameT, args?: ArgumentType[], options?: ContractOptions): NamedArtifactContractDeploymentFuture<ContractNameT>;
contract(contractName: string, artifact: Artifact, args?: ArgumentType[], options?: ContractOptions): ContractDeploymentFuture;
contract<const AbiT extends Abi>(contractName: string, artifact: Artifact<AbiT>, args?: ArgumentType[], options?: ContractOptions): ContractDeploymentFuture<AbiT>;
library<LibraryNameT extends string>(libraryName: LibraryNameT, options?: LibraryOptions): NamedArtifactLibraryDeploymentFuture<LibraryNameT>;
library(libraryName: string, artifact: Artifact, options?: LibraryOptions): LibraryDeploymentFuture;
library<const AbiT extends Abi>(libraryName: string, artifact: Artifact<AbiT>, options?: LibraryOptions): LibraryDeploymentFuture<AbiT>;
call<ContractNameT extends string, FunctionNameT extends string>(contractFuture: CallableContractFuture<ContractNameT>, functionName: FunctionNameT, args?: ArgumentType[], options?: CallOptions): ContractCallFuture<ContractNameT, FunctionNameT>;
staticCall<ContractNameT extends string, FunctionNameT extends string>(contractFuture: CallableContractFuture<ContractNameT>, functionName: FunctionNameT, args?: ArgumentType[], nameOrIndex?: string | number, options?: StaticCallOptions): StaticCallFuture<ContractNameT, FunctionNameT>;
contractAt<ContractNameT extends string>(contractName: ContractNameT, address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>, options?: ContractAtOptions): NamedArtifactContractAtFuture<ContractNameT>;
contractAt(contractName: string, artifact: Artifact, address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>, options?: ContractAtOptions): ContractAtFuture;
contractAt<const AbiT extends Abi>(contractName: string, artifact: Artifact<AbiT>, address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>, options?: ContractAtOptions): ContractAtFuture<AbiT>;
readEventArgument(futureToReadFrom: NamedArtifactContractDeploymentFuture<string> | ContractDeploymentFuture | SendDataFuture | ContractCallFuture<string, string>, eventName: string, nameOrIndex: string | number, options?: ReadEventArgumentOptions): ReadEventArgumentFuture;

@@ -1124,3 +1131,3 @@ send(id: string, to: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string> | AccountRuntimeValue, value?: bigint | ModuleParameterRuntimeValue<bigint>, data?: string, options?: SendDataOptions): SendDataFuture;

*/
export declare interface LibraryDeploymentFuture {
export declare interface LibraryDeploymentFuture<AbiT extends Abi = Abi> {
type: FutureType.LIBRARY_DEPLOYMENT;

@@ -1131,3 +1138,3 @@ id: string;

contractName: string;
artifact: Artifact;
artifact: Artifact<AbiT>;
libraries: Record<string, ContractFuture<string>>;

@@ -1134,0 +1141,0 @@ from: string | AccountRuntimeValue | undefined;

@@ -11,3 +11,3 @@ import { ArtifactResolver } from "./types/artifact";

*/
export declare function deploy<ModuleIdT extends string, ContractNameT extends string, IgnitionModuleResultsT extends IgnitionModuleResult<ContractNameT>>({ config, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender, }: {
export declare function deploy<ModuleIdT extends string, ContractNameT extends string, IgnitionModuleResultsT extends IgnitionModuleResult<ContractNameT>>({ config, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, }: {
config?: Partial<DeployConfig>;

@@ -14,0 +14,0 @@ artifactResolver: ArtifactResolver;

@@ -12,2 +12,3 @@ "use strict";

const jsonrpc_client_1 = require("./internal/execution/jsonrpc-client");
const address_1 = require("./internal/execution/utils/address");
const get_default_sender_1 = require("./internal/execution/utils/get-default-sender");

@@ -22,3 +23,3 @@ const check_automined_network_1 = require("./internal/utils/check-automined-network");

*/
async function deploy({ config = {}, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender, }) {
async function deploy({ config = {}, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, }) {
if (executionEventListener !== undefined) {

@@ -40,12 +41,3 @@ executionEventListener.setModuleId({

}
if (defaultSender !== undefined) {
if (!accounts.includes(defaultSender)) {
throw new errors_1.IgnitionError(errors_list_1.ERRORS.VALIDATION.INVALID_DEFAULT_SENDER, {
defaultSender,
});
}
}
else {
defaultSender = (0, get_default_sender_1.getDefaultSender)(accounts);
}
const defaultSender = _resolveDefaultSender(givenDefaultSender, accounts);
const deploymentLoader = deploymentDir === undefined

@@ -68,2 +60,18 @@ ? new ephemeral_deployment_loader_1.EphemeralDeploymentLoader(artifactResolver, executionEventListener)

exports.deploy = deploy;
function _resolveDefaultSender(givenDefaultSender, accounts) {
let defaultSender;
if (givenDefaultSender !== undefined) {
const isDefaultSenderInAccounts = accounts.some((account) => (0, address_1.equalAddresses)(account, givenDefaultSender));
if (!isDefaultSenderInAccounts) {
throw new errors_1.IgnitionError(errors_list_1.ERRORS.VALIDATION.INVALID_DEFAULT_SENDER, {
defaultSender: givenDefaultSender,
});
}
defaultSender = givenDefaultSender;
}
else {
defaultSender = (0, get_default_sender_1.getDefaultSender)(accounts);
}
return defaultSender;
}
//# sourceMappingURL=deploy.js.map

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.34.4"
"packageVersion": "7.38.3"
}
]
}
/**
* The type of the contract artifact's ABI.
*
* @beta
*/
export type Abi = readonly any[] | any[];
/**
* An compilation artifact representing a smart contract.

@@ -6,7 +12,7 @@ *

*/
export interface Artifact {
export interface Artifact<AbiT extends Abi = Abi> {
contractName: string;
sourceName: string;
bytecode: string;
abi: any[];
abi: AbiT;
linkReferences: Record<string, Record<string, Array<{

@@ -13,0 +19,0 @@ length: number;

@@ -1,2 +0,2 @@

import { Artifact } from "./artifact";
import { Abi, Artifact } from "./artifact";
import { AccountRuntimeValue, AddressResolvableFuture, ArgumentType, CallableContractFuture, ContractAtFuture, ContractCallFuture, ContractDeploymentFuture, ContractFuture, Future, IgnitionModule, IgnitionModuleResult, LibraryDeploymentFuture, ModuleParameterRuntimeValue, ModuleParameterType, NamedArtifactContractAtFuture, NamedArtifactContractDeploymentFuture, NamedArtifactLibraryDeploymentFuture, ReadEventArgumentFuture, SendDataFuture, StaticCallFuture } from "./module";

@@ -95,9 +95,9 @@ /**

contract<ContractNameT extends string>(contractName: ContractNameT, args?: ArgumentType[], options?: ContractOptions): NamedArtifactContractDeploymentFuture<ContractNameT>;
contract(contractName: string, artifact: Artifact, args?: ArgumentType[], options?: ContractOptions): ContractDeploymentFuture;
contract<const AbiT extends Abi>(contractName: string, artifact: Artifact<AbiT>, args?: ArgumentType[], options?: ContractOptions): ContractDeploymentFuture<AbiT>;
library<LibraryNameT extends string>(libraryName: LibraryNameT, options?: LibraryOptions): NamedArtifactLibraryDeploymentFuture<LibraryNameT>;
library(libraryName: string, artifact: Artifact, options?: LibraryOptions): LibraryDeploymentFuture;
library<const AbiT extends Abi>(libraryName: string, artifact: Artifact<AbiT>, options?: LibraryOptions): LibraryDeploymentFuture<AbiT>;
call<ContractNameT extends string, FunctionNameT extends string>(contractFuture: CallableContractFuture<ContractNameT>, functionName: FunctionNameT, args?: ArgumentType[], options?: CallOptions): ContractCallFuture<ContractNameT, FunctionNameT>;
staticCall<ContractNameT extends string, FunctionNameT extends string>(contractFuture: CallableContractFuture<ContractNameT>, functionName: FunctionNameT, args?: ArgumentType[], nameOrIndex?: string | number, options?: StaticCallOptions): StaticCallFuture<ContractNameT, FunctionNameT>;
contractAt<ContractNameT extends string>(contractName: ContractNameT, address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>, options?: ContractAtOptions): NamedArtifactContractAtFuture<ContractNameT>;
contractAt(contractName: string, artifact: Artifact, address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>, options?: ContractAtOptions): ContractAtFuture;
contractAt<const AbiT extends Abi>(contractName: string, artifact: Artifact<AbiT>, address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>, options?: ContractAtOptions): ContractAtFuture<AbiT>;
readEventArgument(futureToReadFrom: NamedArtifactContractDeploymentFuture<string> | ContractDeploymentFuture | SendDataFuture | ContractCallFuture<string, string>, eventName: string, nameOrIndex: string | number, options?: ReadEventArgumentOptions): ReadEventArgumentFuture;

@@ -104,0 +104,0 @@ send(id: string, to: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string> | AccountRuntimeValue, value?: bigint | ModuleParameterRuntimeValue<bigint>, data?: string, options?: SendDataOptions): SendDataFuture;

@@ -1,2 +0,2 @@

import { Artifact } from "./artifact";
import { Abi, Artifact } from "./artifact";
/**

@@ -94,3 +94,3 @@ * Base argument type that smart contracts can receive in their constructors

*/
export interface ContractDeploymentFuture {
export interface ContractDeploymentFuture<AbiT extends Abi = Abi> {
type: FutureType.CONTRACT_DEPLOYMENT;

@@ -101,3 +101,3 @@ id: string;

contractName: string;
artifact: Artifact;
artifact: Artifact<AbiT>;
constructorArgs: ArgumentType[];

@@ -128,3 +128,3 @@ libraries: Record<string, ContractFuture<string>>;

*/
export interface LibraryDeploymentFuture {
export interface LibraryDeploymentFuture<AbiT extends Abi = Abi> {
type: FutureType.LIBRARY_DEPLOYMENT;

@@ -135,3 +135,3 @@ id: string;

contractName: string;
artifact: Artifact;
artifact: Artifact<AbiT>;
libraries: Record<string, ContractFuture<string>>;

@@ -191,3 +191,3 @@ from: string | AccountRuntimeValue | undefined;

*/
export interface ContractAtFuture {
export interface ContractAtFuture<AbiT extends Abi = Abi> {
type: FutureType.CONTRACT_AT;

@@ -199,3 +199,3 @@ id: string;

address: string | AddressResolvableFuture | ModuleParameterRuntimeValue<string>;
artifact: Artifact;
artifact: Artifact<AbiT>;
}

@@ -202,0 +202,0 @@ /**

{
"name": "@nomicfoundation/ignition-core",
"version": "0.12.0",
"version": "0.13.0",
"license": "MIT",

@@ -49,29 +49,5 @@ "author": "Nomic Foundation",

"devDependencies": {
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@nomiclabs/eslint-plugin-hardhat-internal-rules": "^1.0.2",
"@types/chai": "^4.2.22",
"@types/chai-as-promised": "^7.1.5",
"@types/debug": "^4.1.7",
"@types/fs-extra": "^9.0.13",
"@types/mocha": "9.1.1",
"@types/ndjson": "2.0.1",
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "4.31.2",
"@typescript-eslint/parser": "4.31.2",
"chai": "^4.3.4",
"chai-as-promised": "7.1.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-import": "2.24.2",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-no-only-tests": "3.1.0",
"eslint-plugin-prettier": "4.0.0",
"hardhat": "^2.18.0",
"mocha": "^9.1.3",
"nyc": "15.1.0",
"prettier": "2.4.1",
"rimraf": "3.0.2",
"ts-node": "10.9.1",
"typescript": "^5.0.2"
"hardhat": "^2.18.0"
},

@@ -78,0 +54,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc