You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/evm/getting-started.md
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The premise of this document is as follows (for whom this document is intended):
15
15
Since your core functionality is provided via Solidity contracts, we have taken care to provide you with as much examples and instructions as possible to help you navigate the transition from the existing ERC-721 tokens to the Unique native model.
16
16
17
17
:::tip
18
-
One note to be mindful of is: the most efficient way of accomplishing this goal is by using the Unique SDK 2.0. It will provide you with the framework, the tools and the methods to make this fast and easy, so do brush up on your Typescript if you have been away from it for a while. It will save you an enormous amount of time. To make it as real-world as possible, we have implemented our SDK calls in a React framework so you can gauge how the SDK functions in a UI context and you can see it all in the video listed below.
18
+
One note to be mindful of is: the most efficient way of accomplishing this goal is by using the Unique SDK 2.0. It will provide you with the framework, the tools and the methods to make this fast and easy, so do brush up on your Typescript if you have been away from it for a while. It will save you an enormous amount of time. To make it as real-world as possible, we have implemented our SDK calls in a [React framework](https://github.com/UniqueNetwork/unique-react-template) so you can gauge how the SDK functions in a UI context and you can see it all in the video listed below.
19
19
:::
20
20
21
21
That said...
@@ -29,18 +29,18 @@ Once you read through this document, we propose that you attempt to replicate th
29
29
5. Call that contract from the SDK
30
30
6. Nest a token
31
31
32
-
ALL the examples for this except point 6 are shown in this video: https://youtu.be/Cid_Ui5e0rk
32
+
ALL the examples for this except point 6 are shown in [this video](https://youtu.be/Cid_Ui5e0rk).
33
33
34
34
To nest, you just send a native token to a native token address as though it is a wallet using a simple send call via the SDK. That's all. Nesting doesn't even have a dedicated method. It is a simple send of a token to another tokens address.
35
35
36
36
Read on...
37
37
38
38
39
-
#1. EVM and Substrate
39
+
##EVM and Substrate
40
40
41
41
There are two types of accounts – Substrate (5Grw...) and EVM (0x...)
42
42
In terms of calling contracts:
43
-
- EVM accounts operate the same way as in Ethereum, nothing special
43
+
- EVM accounts operate the same way as in Ethereum
44
44
- Substrate accounts cannot call EVM contracts directly because EVM works only with EVM accounts. But they can do it through the `evm.call` extrinsic (in SDK - `sdk.evm.send` method). For contract, `msg.sender` will be Substrate's account mirror – EVM account. To calculate the Substrate account mirror, use the `Address` utility from `@unique-nft/utils`
Documentation section on how to build applications, and specifically [connecting accounts](https://docs.unique.network/build/sdk/v2/dapps.html#connecting-accounts)
110
109
111
-
It could be much easier to understand playing with code. Here is a react template: https://github.com/UniqueNetwork/unique-react-template
110
+
It could be much easier to understand playing with code. Here is a [react template](https://github.com/UniqueNetwork/unique-react-template) you can use.
112
111
113
112
## SDK
114
113
115
114
SDK is only for Substrate accounts (remember that Substrate accounts can invoke contracts).
116
-
The build section of the documentation explains all the needed concepts - https://docs.unique.network/build/sdk/v2/quick-start.html
115
+
The [build](https://docs.unique.network/build/sdk/v2/quick-start.html) section of the documentation explains all the needed concepts.
117
116
118
117
## Why it makes sense to use the schema 2.0 and why you don't have to if you do not need it.
119
118
@@ -125,20 +124,20 @@ We support Unique Schema 2.0, an OpenSea compatible, on-chain metadata format, t
125
124
126
125
However, there is good news—if you use SDK or unique contracts, you don't need to understand this format in detail. You only need to understand its features. Everything else is handled for you.
127
126
128
-
The reference section in the documentation explaining all the features of unique schema – https://docs.unique.network/reference/schemas
129
-
The js library for the unique schema. You don't need it if you use SDK https://github.com/UniqueNetwork/unique_schemas
127
+
The [reference section](https://docs.unique.network/reference/schemas) in the documentation explaining all the features of unique schema.
130
128
131
-
# How to call EVM contracts using Substrate account and SDK
129
+
The [js library for the unique schema](https://github.com/UniqueNetwork/unique_schemas). You don't need it if you use SDK.
-[This function](https://github.com/UniqueNetwork/unique-react-template/blob/ab923457ece54f6ac6d1f2f47fc08ea52363dad1/src/pages/BreedingPage.tsx#L58-L107) covers how to invoke contracts
137
136
138
137
Long story short:
139
138
140
139
- You save the contract's ABI as JSON file and import it
141
-
- You call sdk.evm.send and pass abi, contract address, function name, and params
140
+
- You call `sdk.evm.send` and pass abi, contract address, function name, and params
142
141
143
142
## To change a schema 2.0 compliant data attribute from EVM
144
143
@@ -151,4 +150,4 @@ EVM workhop demonstrates how to do this.
151
150
-[How do we call these solidity functions on the UI](https://github.com/UniqueNetwork/unique-react-template/blob/ab923457ece54f6ac6d1f2f47fc08ea52363dad1/src/pages/BreedingPage.tsx#L138-L173)
152
151
153
152
154
-
Please remember to view this video: https://youtu.be/Cid_Ui5e0rk
153
+
Please remember to view [this video](https://youtu.be/Cid_Ui5e0rk).
Copy file name to clipboardExpand all lines: docs/build/sdk/v2/asset-hub.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Asset Hub
2
2
3
-
The Unique SDK supports the Asset Hub, as well as the uniques and nfts pallets. You can use a publicly available endpoint to interact with the Asset Hub:
3
+
The Unique SDK supports the Asset Hub, as well as the `uniques` and `nfts` pallets. You can use a [publicly available endpoint](../../../reference/sdk-endpoints.md) to interact with the Asset Hub:
0 commit comments