Skip to content

Commit 8266a1e

Browse files
authored
Merge pull request #970 from multiversx/TOOL-238-update-packages-on-sdk-js-examples
Update sdk-js cookbook
2 parents a6b3f4a + d2afba8 commit 8266a1e

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

docs/sdk-and-tools/sdk-js/sdk-js-cookbook-v13.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,22 @@ This page will guide you through the process of handling common tasks using **sd
1313
This cookbook makes use of `sdk-js v13`. In order to migrate from `sdk-js v12.x` to `sdk-js v13`, please also follow [the migration guide](https://github.com/multiversx/mx-sdk-js-core/issues/392).
1414
:::
1515

16-
:::important
17-
This page is a work in progress. Please check back later for more content.
18-
:::
19-
2016
## Creating network providers
2117

2218
Creating an API provider:
2319

2420
```js
2521
import { ApiNetworkProvider } from "@multiversx/sdk-network-providers";
2622

27-
const apiNetworkProvider = new ApiNetworkProvider("https://devnet-api.multiversx.com");
23+
const apiNetworkProvider = new ApiNetworkProvider("https://devnet-api.multiversx.com", { clientName: "multiversx-your-client-name" });
2824
```
2925

3026
Creating a Proxy provider:
3127

3228
```js
3329
import { ProxyNetworkProvider } from "@multiversx/sdk-network-providers";
3430

35-
const proxyNetworkProvider = new ProxyNetworkProvider("https://devnet-gateway.multiversx.com");
31+
const proxyNetworkProvider = new ProxyNetworkProvider("https://devnet-gateway.multiversx.com", { clientName: "multiversx-your-client-name" });
3632
```
3733

3834
Use the classes from `@multiversx/sdk-network-providers` **only as a starting point**.
@@ -201,7 +197,7 @@ Generally speaking, in order to create transactions that transfer native tokens
201197

202198
:::note
203199
In `sdk-core v13`, the [`TransferTransactionsFactory`](https://multiversx.github.io/mx-sdk-js-core/v13/classes/TransferTransactionsFactory.html) class was extended with new methods,
204-
to be aligned with the [SDKs specs](https://github.com/multiversx/mx-sdk-specs/blob/main/core/transactions-factories/transfer_transactions_factory).
200+
to be aligned with the [SDKs specs](https://github.com/multiversx/mx-sdk-specs/blob/main/core/transactions-factories/transfer_transactions_factory.md).
205201
The old, legacy methods are still available (see below), thus existing client code isn't affected.
206202
:::
207203

@@ -343,7 +339,7 @@ import BigNumber from "bignumber.js";
343339

344340
BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_FLOOR });
345341

346-
console.log("Format using bignumber.js:",new BigNumber("1500000000000000000").shiftedBy(-18).toFixed(4));
342+
console.log("Format using bignumber.js:", new BigNumber("1500000000000000000").shiftedBy(-18).toFixed(4));
347343
```
348344

349345
You can parse amounts using `parseAmount` from `sdk-dapp`:
@@ -1073,7 +1069,3 @@ transaction.signature = await signer.sign(bytesToSign);
10731069
:::note
10741070
If you'd like to learn more about hash signing, please refer to the overview on [signing transactions](/developers/signing-transactions).
10751071
:::
1076-
1077-
:::important
1078-
This page is a work in progress. Please check back later for more content.
1079-
:::

0 commit comments

Comments
 (0)