Skip to content

Commit

Permalink
Cleanup: counter vs. adder.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Nov 24, 2024
1 parent 481dd2d commit 0e31281
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/sdk-and-tools/sdk-js/sdk-js-cookbook-v12.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ const tx4 = factory.createMultiESDTNFTTransfer({
import { Code } from "@multiversx/sdk-core";
import { promises } from "fs";

let buffer = await promises.readFile("../contracts/counter.wasm");
let buffer = await promises.readFile("../contracts/adder.wasm");
let code = Code.fromBuffer(buffer);
```

Expand All @@ -326,7 +326,7 @@ let code = Code.fromBuffer(buffer);
```js
import axios from "axios";

let response = await axios.get("https://github.com/multiversx/mx-sdk-js-core/raw/main/src/testdata/counter.wasm", {
let response = await axios.get("https://github.com/multiversx/mx-sdk-js-core/raw/main/src/testdata/adder.wasm", {
responseType: "arraybuffer",
transformResponse: [],
headers: {
Expand Down Expand Up @@ -421,7 +421,7 @@ console.log("Return code:", returnCode);
import { AbiRegistry, Address, SmartContract } from "@multiversx/sdk-core";
import { promises } from "fs";

let abiJson = await promises.readFile("../contracts/counter.abi.json", { encoding: "utf8" });
let abiJson = await promises.readFile("../contracts/adder.abi.json", { encoding: "utf8" });
let abiObj = JSON.parse(abiJson);
let abiRegistry = AbiRegistry.create(abiObj);
let existingContractAddress = Address.fromBech32("erd1qqqqqqqqqqqqqpgq5sup58y38q3pwyqklagxmuraetshrqwpd8ssh0ssph");
Expand All @@ -435,7 +435,7 @@ let existingContract = new SmartContract({ address: existingContractAddress, abi
```js
import axios from "axios";

const response = await axios.get("https://github.com/multiversx/mx-sdk-js-core/raw/main/src/testdata/counter.abi.json");
const response = await axios.get("https://github.com/multiversx/mx-sdk-js-core/raw/main/src/testdata/adder.abi.json");
abiRegistry = AbiRegistry.create(response.data);
existingContract = new SmartContract({ address: existingContractAddress, abi: abiRegistry });
```
Expand Down Expand Up @@ -742,13 +742,13 @@ console.log(untypedBundle.returnCode, untypedBundle.values.length);

```js
let endpointDefinition = AbiRegistry.create({
"name": "counter",
"name": "adder",
"endpoints": [{
"name": "increment",
"inputs": [],
"outputs": [{ "type": "i64" }]
"name": "add",
"inputs": [{ "type": "u64" }],
"outputs": [{ "type": "u64" }]
}]
}).getEndpoint("increment");
}).getEndpoint("add");

transactionOnNetwork = await networkProvider.getTransaction(txHash);
let typedBundle = resultsParser.parseOutcome(transactionOnNetwork, endpointDefinition);
Expand Down

0 comments on commit 0e31281

Please sign in to comment.