@vechain/sdk-ethers-adapter
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-beta.7
import { vechain_sdk_core_ethers } from '@vechain/sdk-core'; | ||
import { HardhatVechainProvider } from '@vechain/sdk-network'; | ||
import { HardhatVeChainProvider } from '@vechain/sdk-network'; | ||
/** | ||
* Contract adapter for the vechain hardhat plugin | ||
* Contract adapter for the VeChain hardhat plugin | ||
* | ||
* @param contract - The contract to adapt to the vechain network | ||
* @param hardhatVechainProvider - The hardhat vechain provider | ||
* @param contract - The contract to adapt to the VeChain network | ||
* @param hardhatVeChainProvider - The hardhatVeChain provider | ||
* @returns The adapted contract | ||
*/ | ||
declare const contractAdapter: (contract: vechain_sdk_core_ethers.Contract, hardhatVechainProvider: HardhatVechainProvider) => vechain_sdk_core_ethers.Contract; | ||
declare const contractAdapter: (contract: vechain_sdk_core_ethers.Contract, hardhatVeChainProvider: HardhatVeChainProvider) => vechain_sdk_core_ethers.Contract; | ||
/** | ||
* Factory adapter for the vechain hardhat plugin | ||
* Factory adapter for the VeChain hardhat plugin | ||
* | ||
* @param contractFactory - The contract factory to adapt to the vechain network | ||
* @param hardhatVechainProvider - The hardhat vechain provider | ||
* @param contractFactory - The contract factory to adapt to the VeChain network | ||
* @param hardhatVeChainProvider - The hardhatVeChain provider | ||
* @returns The adapted contract factory | ||
*/ | ||
declare function factoryAdapter<A extends unknown[], I>(contractFactory: vechain_sdk_core_ethers.ContractFactory<A, I>, hardhatVechainProvider: HardhatVechainProvider): vechain_sdk_core_ethers.ContractFactory<A, I>; | ||
declare function factoryAdapter<A extends unknown[], I>(contractFactory: vechain_sdk_core_ethers.ContractFactory<A, I>, hardhatVeChainProvider: HardhatVeChainProvider): vechain_sdk_core_ethers.ContractFactory<A, I>; | ||
declare const helpers: { | ||
getContractAddress: (txId: string, hardhatVechainProvider: HardhatVechainProvider) => Promise<string>; | ||
getContractAddress: (txId: string, hardhatVeChainProvider: HardhatVeChainProvider) => Promise<string>; | ||
}; | ||
@@ -25,0 +25,0 @@ |
@@ -39,4 +39,4 @@ "use strict"; | ||
// src/adapters/helpers.ts | ||
var getContractAddress = async (txId, hardhatVechainProvider) => { | ||
const tx = await hardhatVechainProvider.thorClient.transactions.waitForTransaction( | ||
var getContractAddress = async (txId, hardhatVeChainProvider) => { | ||
const tx = await hardhatVeChainProvider.thorClient.transactions.waitForTransaction( | ||
txId | ||
@@ -51,7 +51,7 @@ ); | ||
// src/adapters/contract-adapter.ts | ||
var contractAdapter = (contract, hardhatVechainProvider) => { | ||
var contractAdapter = (contract, hardhatVeChainProvider) => { | ||
contract.getAddress = async function getAddress() { | ||
return await helpers.getContractAddress( | ||
contract.deploymentTransaction()?.hash ?? "", | ||
hardhatVechainProvider | ||
hardhatVeChainProvider | ||
); | ||
@@ -64,3 +64,3 @@ }; | ||
var import_sdk_core = require("@vechain/sdk-core"); | ||
function factoryAdapter(contractFactory, hardhatVechainProvider) { | ||
function factoryAdapter(contractFactory, hardhatVeChainProvider) { | ||
contractFactory.deploy = async function(...args) { | ||
@@ -77,3 +77,3 @@ const tx = await this.getDeployTransaction(...args); | ||
const sentTx = await this.runner.sendTransaction(tx); | ||
const receipt = await hardhatVechainProvider.thorClient.transactions.waitForTransaction( | ||
const receipt = await hardhatVeChainProvider.thorClient.transactions.waitForTransaction( | ||
sentTx.hash | ||
@@ -80,0 +80,0 @@ ); |
{ | ||
"name": "@vechain/sdk-ethers-adapter", | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-beta.7", | ||
"description": "This module serves as a crucial bridge between the standard Ethereum tooling provided by Hardhat and the unique features of the vechain thor blockchain", | ||
@@ -37,4 +37,4 @@ "author": "vechain Foundation", | ||
"dependencies": { | ||
"@vechain/sdk-core": "1.0.0-beta.6", | ||
"@vechain/sdk-network": "1.0.0-beta.6" | ||
"@vechain/sdk-core": "1.0.0-beta.7", | ||
"@vechain/sdk-network": "1.0.0-beta.7" | ||
}, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
# @vechain/sdk-ethers-adapter | ||
Welcome to the **sdk-ethers-adapter** package of the vechain SDK! This package serves as a crucial bridge between the standard Ethereum tooling provided by Hardhat and the unique features of the vechain Thor blockchain. By utilizing this adapter, the hardhat vechain plugin can seamlessly integrate veChain's capabilities, leveraging the Hardhat environment for smart contract deployment and testing on veChain's network. | ||
Welcome to the **sdk-ethers-adapter** package of the VeChain SDK! This package serves as a crucial bridge between the standard Ethereum tooling provided by Hardhat and the unique features of the VeChain Thor blockchain. By utilizing this adapter, the hardhatVeChain plugin can seamlessly integrate veChain's capabilities, leveraging the Hardhat environment for smart contract deployment and testing on veChain's network. | ||
@@ -9,5 +9,5 @@ ## Features | ||
- **vechain Extensions**: Implements vechain-specific functionalities, such as multi-clause transactions, fee delegation, and native token (VET and VTHO) handling. | ||
- **Custom Provider**: Includes a VeChainThor Provider to interact with the vechain Thor blockchain. | ||
- **Custom Provider**: Includes a VeChainThor Provider to interact with the VeChain Thor blockchain. | ||
- **Transaction Signing**: Enhancements for signing transactions using vechain's unique model, including support for block ref and expiration. | ||
- **Contract Interaction**: Facilitates interaction with contracts deployed on the vechain Thor blockchain, taking into account vechain-specific transaction parameters. | ||
- **Contract Interaction**: Facilitates interaction with contracts deployed on the VeChain Thor blockchain, taking into account vechain-specific transaction parameters. | ||
@@ -14,0 +14,0 @@ ## Installation |
import { type vechain_sdk_core_ethers } from '@vechain/sdk-core'; | ||
import { type HardhatVechainProvider } from '@vechain/sdk-network'; | ||
import { type HardhatVeChainProvider } from '@vechain/sdk-network'; | ||
import { helpers } from './helpers'; | ||
/** | ||
* Contract adapter for the vechain hardhat plugin | ||
* Contract adapter for the VeChain hardhat plugin | ||
* | ||
* @param contract - The contract to adapt to the vechain network | ||
* @param hardhatVechainProvider - The hardhat vechain provider | ||
* @param contract - The contract to adapt to the VeChain network | ||
* @param hardhatVeChainProvider - The hardhatVeChain provider | ||
* @returns The adapted contract | ||
@@ -14,3 +14,3 @@ */ | ||
contract: vechain_sdk_core_ethers.Contract, | ||
hardhatVechainProvider: HardhatVechainProvider | ||
hardhatVeChainProvider: HardhatVeChainProvider | ||
): vechain_sdk_core_ethers.Contract => { | ||
@@ -20,3 +20,3 @@ contract.getAddress = async function getAddress(): Promise<string> { | ||
contract.deploymentTransaction()?.hash ?? '', | ||
hardhatVechainProvider | ||
hardhatVeChainProvider | ||
); | ||
@@ -23,0 +23,0 @@ }; |
@@ -1,9 +0,9 @@ | ||
import type { HardhatVechainProvider } from '@vechain/sdk-network'; | ||
import type { HardhatVeChainProvider } from '@vechain/sdk-network'; | ||
import { vechain_sdk_core_ethers } from '@vechain/sdk-core'; | ||
/** | ||
* Factory adapter for the vechain hardhat plugin | ||
* Factory adapter for the VeChain hardhat plugin | ||
* | ||
* @param contractFactory - The contract factory to adapt to the vechain network | ||
* @param hardhatVechainProvider - The hardhat vechain provider | ||
* @param contractFactory - The contract factory to adapt to the VeChain network | ||
* @param hardhatVeChainProvider - The hardhatVeChain provider | ||
* @returns The adapted contract factory | ||
@@ -13,3 +13,3 @@ */ | ||
contractFactory: vechain_sdk_core_ethers.ContractFactory<A, I>, | ||
hardhatVechainProvider: HardhatVechainProvider | ||
hardhatVeChainProvider: HardhatVeChainProvider | ||
): vechain_sdk_core_ethers.ContractFactory<A, I> { | ||
@@ -34,3 +34,3 @@ contractFactory.deploy = async function ( | ||
const receipt = | ||
await hardhatVechainProvider.thorClient.transactions.waitForTransaction( | ||
await hardhatVeChainProvider.thorClient.transactions.waitForTransaction( | ||
sentTx.hash | ||
@@ -37,0 +37,0 @@ ); |
@@ -1,2 +0,2 @@ | ||
import type { HardhatVechainProvider } from '@vechain/sdk-network'; | ||
import type { HardhatVeChainProvider } from '@vechain/sdk-network'; | ||
@@ -6,3 +6,3 @@ /** | ||
* @param txId - The contract deployment transaction id | ||
* @param hardhatVechainProvider - The hardhat vechain provider | ||
* @param hardhatVeChainProvider - The hardhatVeChain provider | ||
* @returns The contract address | ||
@@ -12,6 +12,6 @@ */ | ||
txId: string, | ||
hardhatVechainProvider: HardhatVechainProvider | ||
hardhatVeChainProvider: HardhatVeChainProvider | ||
): Promise<string> => { | ||
const tx = | ||
await hardhatVechainProvider.thorClient.transactions.waitForTransaction( | ||
await hardhatVeChainProvider.thorClient.transactions.waitForTransaction( | ||
txId | ||
@@ -18,0 +18,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
14295
+ Added@vechain/sdk-core@1.0.0-beta.7(transitive)
+ Added@vechain/sdk-errors@1.0.0-beta.7(transitive)
+ Added@vechain/sdk-logging@1.0.0-beta.7(transitive)
+ Added@vechain/sdk-network@1.0.0-beta.7(transitive)
- Removed@vechain/sdk-core@1.0.0-beta.6(transitive)
- Removed@vechain/sdk-errors@1.0.0-beta.6(transitive)
- Removed@vechain/sdk-logging@1.0.0-beta.6(transitive)
- Removed@vechain/sdk-network@1.0.0-beta.6(transitive)