diff --git a/package.json b/package.json index a5f3564..a30e005 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "0.0.0", + "version": "0.0.3", "author": "Electi Consulting LTD", "license": "See individual packages", "private": true, @@ -17,9 +17,9 @@ "web3": "^1.0.0-beta.36", "mocha": "^10.2.0", "@types/mocha": "^10.0.1", - "@vechain/hardhat-vechain": "0.0.1", - "@vechain/hardhat-ethers": "0.0.1", - "@vechain/hardhat-web3": "0.0.1" + "@vechain/hardhat-vechain": "0.0.3", + "@vechain/hardhat-ethers": "0.0.3", + "@vechain/hardhat-web3": "0.0.3" }, "peerDependencies": { "hardhat": "^2.12.7" diff --git a/packages/ethers/README.md b/packages/ethers/README.md index e70cfb4..0083118 100644 --- a/packages/ethers/README.md +++ b/packages/ethers/README.md @@ -25,6 +25,32 @@ module.exports = { }; ``` +## Sample `hardhat.config.js` with fee delegation + +Fee delegation can be configured by providing optional ```delegate``` config which has required ``url`` and optional ``signer`` field. Url needs to point to delegation a valid +delegation service, for example ```https://sponsor-testnet.vechain.energy/by/${projectId}```. +```js +const { + VECHAIN_URL_SOLO +} = require("@vechain/hardhat-vechain"); +require("@vechain/hardhat-web3"); + +module.exports = { + solidity: { + version: "0.8.17", + }, + networks: { + vechain: { + url: VECHAIN_URL_SOLO, + delegate: { + url: "${feeDelegationServiceUrl}", + signer: "${optionalSigner}" + } + }, + } +}; +``` + ## Testing - Use Hardhat Ethers as usual ```js diff --git a/packages/ethers/package.json b/packages/ethers/package.json index dc394d1..8251b67 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -1,6 +1,6 @@ { "name": "@vechain/hardhat-ethers", - "version": "0.0.2", + "version": "0.0.3", "license": "MIT", "description": "Hardhat Vechain Ethers Plugin", "repository": "github:vechainfoundation/hardhat-plugins", @@ -18,13 +18,13 @@ "ethers": "^5.0.0", "hardhat": "^2.12.7", "@nomiclabs/hardhat-ethers": "^2.2.2", - "@vechain/hardhat-vechain": "^0.0.2" + "@vechain/hardhat-vechain": "^0.0.3" }, "peerDependencies": { "ethers": "^5.0.0", "hardhat": "^2.12.7", "@nomiclabs/hardhat-ethers": "^2.2.2", - "@vechain/hardhat-vechain": "^0.0.2" + "@vechain/hardhat-vechain": "^0.0.3" } } \ No newline at end of file diff --git a/packages/vechain/README.md b/packages/vechain/README.md index 25fc124..96e1e31 100644 --- a/packages/vechain/README.md +++ b/packages/vechain/README.md @@ -25,12 +25,38 @@ module.exports = { }; ``` +## Sample `hardhat.config.js` with fee delegation + +Fee delegation can be configured by providing optional ```delegate``` config which has required ``url`` and optional ``signer`` field. Url needs to point to delegation a valid +delegation service, for example ```https://sponsor-testnet.vechain.energy/by/${projectId}```. +```js +const { + VECHAIN_URL_SOLO +} = require("@vechain/hardhat-vechain"); +require("@vechain/hardhat-web3"); + +module.exports = { + solidity: { + version: "0.8.17", + }, + networks: { + vechain: { + url: VECHAIN_URL_SOLO, + delegate: { + url: "${feeDelegationServiceUrl}", + signer: "${optionalSigner}" + } + }, + } +}; +``` + ## Testing - Access the provider using the globally available `vechain` ```js describe("vechain", function() { it("should be able to send requests", async function () { - const accounts = await vechain.request(method: "eth_accounts"); + const accounts = await vechain.request({ method: "eth_accounts" }); assert.equals(accounts[0], "0xf077b491b355e64048ce21e3a6fc4751eeea77fa"); }); }); diff --git a/packages/vechain/package.json b/packages/vechain/package.json index 198b86e..804d0c6 100644 --- a/packages/vechain/package.json +++ b/packages/vechain/package.json @@ -1,6 +1,6 @@ { "name": "@vechain/hardhat-vechain", - "version": "0.0.2", + "version": "0.0.3", "description": "Hardhat plugin for a VeChain provider", "homepage": "https://github.com/vechainfoundation/hardhat-plugins", "repository": "github:vechainfoundation/hardhat-plugins", diff --git a/packages/web3/README.md b/packages/web3/README.md index 803f373..6fe4a92 100644 --- a/packages/web3/README.md +++ b/packages/web3/README.md @@ -25,6 +25,32 @@ module.exports = { }; ``` +## Sample `hardhat.config.js` with fee delegation + +Fee delegation can be configured by providing optional ```delegate``` config which has required ``url`` and optional ``signer`` field. Url needs to point to delegation a valid +delegation service, for example ```https://sponsor-testnet.vechain.energy/by/${projectId}```. +```js +const { + VECHAIN_URL_SOLO +} = require("@vechain/hardhat-vechain"); +require("@vechain/hardhat-web3"); + +module.exports = { + solidity: { + version: "0.8.17", + }, + networks: { + vechain: { + url: VECHAIN_URL_SOLO, + delegate: { + url: "${feeDelegationServiceUrl}", + signer: "${optionalSigner}" + } + }, + } +}; +``` + ## Testing - Use Hardhat web3 as usual ```js diff --git a/packages/web3/package.json b/packages/web3/package.json index f2e2a21..e6ac928 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -1,6 +1,6 @@ { "name": "@vechain/hardhat-web3", - "version": "0.0.2", + "version": "0.0.3", "description": "Hardhat Vechain Web3 Plugin", "repository": "github:vechainfoundation/hardhat-plugins", "author": "Electi Consulting LTD", @@ -23,12 +23,12 @@ "web3": "^1.0.0-beta.36", "hardhat": "^2.12.7", "@nomiclabs/hardhat-web3": "^2.0.0", - "@vechain/hardhat-vechain": "^0.0.2" + "@vechain/hardhat-vechain": "^0.0.3" }, "peerDependencies": { "web3": "^1.0.0-beta.36", "hardhat": "^2.12.7", "@nomiclabs/hardhat-web3": "^2.0.0", - "@vechain/hardhat-vechain": "^0.0.2" + "@vechain/hardhat-vechain": "^0.0.3" } } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index fe720d3..9095e7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -744,6 +744,13 @@ "@types/node" "*" "@types/responselike" "^1.0.0" +"@types/debug@^4.1.7": + version "4.1.8" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.8.tgz#cef723a5d0a90990313faec2d1e22aee5eecb317" + integrity sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ== + dependencies: + "@types/ms" "*" + "@types/http-cache-semantics@*": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" @@ -766,6 +773,11 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.1.tgz#2f4f65bb08bc368ac39c96da7b2f09140b26851b" integrity sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q== +"@types/ms@*": + version "0.7.31" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" + integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== + "@types/node@*": version "18.13.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850" @@ -1551,7 +1563,7 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.3: +debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==