Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/developers/relayed-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ Here's an example of a relayed v3 transaction. Its intent is to call the `add` m

The SDKs have built-in support for relayed transactions. Please follow:
- [mxpy support](/sdk-and-tools/mxpy/mxpy-cli/#relayed-transactions-v3)
- [sdk-py support](/sdk-and-tools/sdk-py/sdk-py-cookbook/#relayed-transactions)
- [sdk-py support](/sdk-and-tools/sdk-py/#relayed-transactions)
- [sdk-js v14 support](/sdk-and-tools/sdk-js/sdk-js-cookbook#relayed-transactions)
- [sdk-js v13 support (legacy)](/sdk-and-tools/sdk-js/sdk-js-cookbook-v13#preparing-a-relayed-transaction)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title: Signing programmatically
In order to sign a transaction (or a message) using one of the SDKs, follow:

- [Signing objects using **sdk-js**](/sdk-and-tools/sdk-js/sdk-js-cookbook#signing-objects)
- [Signing objects using **sdk-py**](/sdk-and-tools/sdk-py/sdk-py-cookbook#signing-objects)
- [Signing objects using **sdk-py**](/sdk-and-tools/sdk-py#signing-objects)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Then it's serialized form (step 5 is omitted in this example) is as follows:

## **Ed25519 signature**

MultiversX uses the [Ed25519](https://ed25519.cr.yp.to/) algorithm to sign transactions. In order to obtain the signature, one can use generic software libraries such as [PyNaCl](https://pynacl.readthedocs.io/en/stable/signing/), [tweetnacl-js](https://github.com/dchest/tweetnacl-js#signatures) or components of MultiversX SDK such as [mx-sdk-js-wallet](https://github.com/multiversx/mx-sdk-js-wallet), [mx-sdk-py-wallet](https://github.com/multiversx/mx-sdk-py-wallet), [sdk-go](https://github.com/multiversx/mx-sdk-go), [mxjava](https://github.com/multiversx/mx-sdk-java), [mx-sdk-js-wallet-cli](https://github.com/multiversx/mx-sdk-js-wallet-cli) etc.
MultiversX uses the [Ed25519](https://ed25519.cr.yp.to/) algorithm to sign transactions. In order to obtain the signature, one can use generic software libraries such as [PyNaCl](https://pynacl.readthedocs.io/en/stable/signing/), [tweetnacl-js](https://github.com/dchest/tweetnacl-js#signatures) or components of MultiversX SDK such as [mx-sdk-js-core](https://github.com/multiversx/mx-sdk-js-core), [mx-sdk-py](https://github.com/multiversx/mx-sdk-py), [sdk-go](https://github.com/multiversx/mx-sdk-go), [mxjava](https://github.com/multiversx/mx-sdk-java) etc.

The raw signature consisting of 64 bytes has to be **hex-encoded** afterwards and placed in the transaction object.

Expand Down
46 changes: 1 addition & 45 deletions docs/developers/signing-transactions/tools-for-signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Tools for signing
---
[comment]: # (mx-abstract)

In order to sign a transaction without actually dispatching it, several tools can be used. Two of the most popular ones are: [mxpy](/sdk-and-tools/sdk-py) or [sdk-js-wallet-cli](/sdk-and-tools/sdk-js-wallet-cli).
In order to sign a transaction without actually dispatching it, several tools can be used. One of the most popular ones is [mxpy](/sdk-and-tools/sdk-py).

[comment]: # (mx-context-auto)

Expand Down Expand Up @@ -52,50 +52,6 @@ In either case, the output file looks like this:

[comment]: # (mx-context-auto)

## **Sign using [sdk-js-wallet-cli](/sdk-and-tools/sdk-js-wallet-cli)**

Given an unsigned transaction in a JSON file:

```
{
"nonce": 42,
"receiver": "erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35r",
"value": "100000000000000000",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "food for cats",
"chainID": "1",
"version": 1
}
```

You can sign it as follows:

```
$ mxjs-wallet sign -i ./aliceToBob.json -o ./aliceToBobSigned.json \
-k walletKeyOfAlice.json -p passwordOfAlice.txt
```

The signed transaction looks like this:

```
{
"nonce": 42,
"value": "100000000000000000",
"receiver": "erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35r",
"sender": "erd1ylzm22ngxl2tspgvwm0yth2myr6dx9avtx83zpxpu7rhxw4qltzs9tmjm9",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9vZCBmb3IgY2F0cw==",
"chainID": "1",
"version": 1,
"signature": "5845301de8ca3a8576166fb3b7dd25124868ce54b07eec7022ae3ffd8d4629540dbb7d0ceed9455a259695e2665db614828728d0f9b0fb1cc46c07dd669d2f0e"
}

```

[comment]: # (mx-context-auto)

## **Other signing tools**

Each SDK includes functions for signing and broadcasting transactions. Please refer to [SDKs & Tools](/sdk-and-tools/overview) for the full list.
6 changes: 0 additions & 6 deletions docs/sdk-and-tools/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ Note that Rust is also the recommended programming language for writing Smart Co
| [Writing and testing sdk-js interactions](/sdk-and-tools/sdk-js/writing-and-testing-sdk-js-interactions) | Write sdk-js interactions for Visual Studio Code |
| [sdk-js signing providers](/sdk-and-tools/sdk-js/sdk-js-signing-providers) | Integrate sdk-js signing providers. |

In addition to sdk-js, one could use the following Javascript library for performing wallet operations via CLI:

| Name | Description |
| ----------------------------------------------------- | ------------------------------------------------------------ |
| [sdk-js-wallet-cli](/sdk-and-tools/sdk-js-wallet-cli) | Lightweight CLI wrapper used to perform wallet interactions. |

You might also want to have a look over [**xSuite**](https://xsuite.dev), a toolkit to init, build, test, deploy contracts using JavaScript, made by the [Arda team](https://arda.run).

[comment]: # (mx-context-auto)
Expand Down
12 changes: 0 additions & 12 deletions docs/sdk-and-tools/sdk-js-wallet-cli.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ title: Writing and testing interactions

Generally speaking, we recommended to use [sc-meta CLI](/developers/meta/sc-meta-cli) to [generate the boilerplate code for your contract interactions](/developers/meta/sc-meta-cli/#calling-snippets).

Though, for writing contract interaction snippets in **JavaScript** or **TypeScript**, please refer to the [`sdk-js` cookbook](/sdk-and-tools/sdk-js/sdk-js-cookbook). If you'd like these snippets to function as system tests of your contract, a choice would be to structure them as Mocha or Jest tests - take the `*.local.net.spec.ts` tests in [`mx-sdk-js-core`](https://github.com/multiversx/mx-sdk-js-core) as examples. For writing contract interaction snippets in **Python**, please refer to the [`sdk-py` cookbook](/sdk-and-tools/sdk-py/sdk-py-cookbook) - if desired, you can shape them as simple scripts, as Python unit tests, or as Jupyter notebooks.
Though, for writing contract interaction snippets in **JavaScript** or **TypeScript**, please refer to the [`sdk-js` cookbook](/sdk-and-tools/sdk-js/sdk-js-cookbook). If you'd like these snippets to function as system tests of your contract, a choice would be to structure them as Mocha or Jest tests - take the `*.local.net.spec.ts` tests in [`mx-sdk-js-core`](https://github.com/multiversx/mx-sdk-js-core) as examples. For writing contract interaction snippets in **Python**, please refer to the [`sdk-py` cookbook](/sdk-and-tools/sdk-py) - if desired, you can shape them as simple scripts, as Python unit tests, or as Jupyter notebooks.

You might also want to have a look over [**xSuite**](https://xsuite.dev), a toolkit to init, build, test, deploy contracts using JavaScript, made by the [Arda team](https://arda.run).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: sdk-py-cookbook
title: Cookbook (v1)
pagination_prev: sdk-and-tools/sdk-py/sdk-py-cookbook-v0
id: sdk-py
title: Python SDK
pagination_prev: developers/testing/testing-in-go
pagination_next: sdk-and-tools/mxpy/installing-mxpy
---

Expand Down
Loading
Loading