From 0b7a0bcec2e3be443a1f1857583e2b0370ac9320 Mon Sep 17 00:00:00 2001 From: Eshel Date: Mon, 23 Sep 2024 14:19:52 +0300 Subject: [PATCH] fixing getNetworkPublicKey to not include securityZone param --- docs/devdocs/FhenixJS/Network Keys.mdx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/devdocs/FhenixJS/Network Keys.mdx b/docs/devdocs/FhenixJS/Network Keys.mdx index 4385eebe..d82ed896 100644 --- a/docs/devdocs/FhenixJS/Network Keys.mdx +++ b/docs/devdocs/FhenixJS/Network Keys.mdx @@ -25,22 +25,25 @@ The Public Key is constant for the lifetime of the network, but still has to be ```javascript -const networkPkAbi = new Interface(["function getNetworkPublicKey(int32 securityZone)"]); -const callData = networkPkAbi.encodeFunctionData("getNetworkPublicKey", [0]); // last param is the security zone, generally 0 +const networkPkAbi = new Interface(["function getNetworkPublicKey()"]) let result = await provider.call({ to: "0x0000000000000000000000000000000000000080", - data: callData + data: networkPkAbi.encodeFunctionData("getNetworkPublicKey"); }); ``` ```javascript -const networkPkSig = web3.eth.abi.encodeFunctionSignature("function getNetworkPublicKey(int32 securityZone)"); -const param = web3.eth.abi.encodeParameter("int32", 0); // last param is the security zone, generally 0 +const networkPkSig = web3.eth.abi.encodeFunctionSignature("getNetworkPublicKey()"); let result = await web3.eth.call({ to: "0x0000000000000000000000000000000000000080", - data: networkPkSig + param + data: networkPkSig }); ``` + +```shell +cast call 0x0000000000000000000000000000000000000080 --rpc-url "https://api.helium.fhenix.zone" "getNetworkPublicKey()" +``` +