ryt-sdk 1.0.1 โ 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -238
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
# ๐ RYT SDK
|
|
2
1
|
|
|
3
|
-
RYT blockchain SDK for provider, wallet, and smart contract interactions.
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
[RYT](https://ryt.io/) is a modern blockchain infrastructure platform designed to make decentralized development faster, simpler, and more accessible. It provides developers with a powerful yet streamlined ecosystem for building, deploying, and interacting with smart contracts, wallets, and scalable applications. By combining intuitive tooling with advanced features like deterministic deployments, proxy patterns, and modular contract architecture, RYT.io removes much of the complexity traditionally associated with Web3 development. Whether you're launching tokens, building dApps, or optimizing on-chain performance, RYT.io empowers you to focus on innovation while handling the heavy lifting behind the scenes.
|
|
4
|
+
|
|
5
|
+
This is our RYT blockchain sdk for provider, wallet, and smart contract interactions.
|
|
6
|
+
|
|
7
|
+
- โก This is only a quick start guide.
|
|
8
|
+
- ๐ For detail developer documentation and guide that how to interact with ryt chain visit ๐ [Homepage](https://ryt-docs.vercel.app/)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### โ๏ธ Install
|
|
6
12
|
|
|
7
13
|
```bash
|
|
8
14
|
npm install ryt-sdk
|
|
@@ -13,7 +19,7 @@ or
|
|
|
13
19
|
yarn add ryt-sdk
|
|
14
20
|
```
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
### ๐ Environment Setup
|
|
17
23
|
|
|
18
24
|
Create a .env file:
|
|
19
25
|
|
|
@@ -28,7 +34,7 @@ SALT=random_salt
|
|
|
28
34
|
MATH_LIB_ADDRESS=0xLibraryAddress
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
### โก 30-Second Quickstart
|
|
32
38
|
|
|
33
39
|
```bash
|
|
34
40
|
import RYTProvider from "ryt-sdk/provider";
|
|
@@ -49,7 +55,7 @@ await tx.wait();
|
|
|
49
55
|
```
|
|
50
56
|
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
### ๐ Overview
|
|
53
59
|
|
|
54
60
|
RYT SDK is a modular blockchain development toolkit designed to simplify:
|
|
55
61
|
|
|
@@ -61,246 +67,18 @@ RYT SDK is a modular blockchain development toolkit designed to simplify:
|
|
|
61
67
|
- Cloning (EIP-1167)
|
|
62
68
|
- Library-linked contracts
|
|
63
69
|
|
|
64
|
-
## ๐ง Architecture
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
Your App
|
|
68
|
-
โ
|
|
69
|
-
โผ
|
|
70
|
-
RYT SDK Core
|
|
71
|
-
โโโ Provider
|
|
72
|
-
โโโ Wallet
|
|
73
|
-
โโโ Contract
|
|
74
|
-
โโโ Deployment Engine
|
|
75
|
-
โ
|
|
76
|
-
โผ
|
|
77
|
-
RYT/ Ethereum / EVM Chain
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## ๐งฉ Core Modules
|
|
81
|
-
|
|
82
|
-
#### Provider
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
import RYTProvider from "ryt-sdk/provider";
|
|
86
|
-
|
|
87
|
-
const provider = new RYTProvider({
|
|
88
|
-
chainId: 1234,
|
|
89
|
-
rpcUrls: ["https://rpc-url"]
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### Wallet
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
import RYTWallet from "ryt-sdk/wallet";
|
|
97
|
-
|
|
98
|
-
const wallet = new RYTWallet(PRIVATE_KEY, provider);
|
|
99
|
-
|
|
100
|
-
console.log(wallet.getAddress());
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
#### Contract
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
import RYTContract from "ryt-sdk/contract";
|
|
107
|
-
|
|
108
|
-
const contract = new RYTContract(address, abi, wallet);
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### ๐ Read Contract Data
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
const name = await contract.read("name");
|
|
115
|
-
const symbol = await contract.read("symbol");
|
|
116
|
-
const decimals = await contract.read("decimals");
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### โ๏ธ Write Transactions
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
const tx = await contract.write("transfer", to, 100n);
|
|
123
|
-
await tx.wait();
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
### ๐ช ERC20 Example
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
const token = new RYTContract(address, ERC20.abi, wallet);
|
|
131
|
-
|
|
132
|
-
await token.write("transfer", recipient, 100n);
|
|
133
|
-
await token.write("approve", spender, 100n);
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### ๐จ ERC721 Mint
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
const nft = new RYTContract(address, ERC721.abi, wallet);
|
|
141
|
-
|
|
142
|
-
await nft.write("safeMint", wallet.getAddress(), TOKEN_URI);
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
### ๐งฉ ERC1155 Mint
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
const multi = new RYTContract(address, ERC1155.abi, wallet);
|
|
150
|
-
|
|
151
|
-
await multi.write("mint", wallet.getAddress(), 1, 20);
|
|
152
|
-
```
|
|
153
|
-
|
|
154
70
|
|
|
155
|
-
###
|
|
71
|
+
### ๐งช Testing
|
|
156
72
|
|
|
157
|
-
|
|
158
|
-
const contract = await deployer.deploy({
|
|
159
|
-
abi: ERC20.abi,
|
|
160
|
-
bytecode: ERC20.bytecode,
|
|
161
|
-
args: ["My Token", "MTK", 18, 1000000]
|
|
162
|
-
});
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### ๐ญ Factory Deployments
|
|
166
|
-
|
|
167
|
-
#### Master Factory
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
const factory = await deployer.deploy({
|
|
171
|
-
abi: MasterFactory.abi,
|
|
172
|
-
bytecode: MasterFactory.bytecode,
|
|
173
|
-
args: [100]
|
|
174
|
-
});
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
#### Create
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
const tx = await factory.write("deploySimple", 777);
|
|
181
|
-
await tx.wait();
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
#### Create2
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
const tx = await factory.write("deployCreate2", 999, salt);
|
|
188
|
-
await tx.wait();
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
#### Cloning (EIP-1167)
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
const tx = await factory.write("deployClone", childAddr);
|
|
195
|
-
await tx.wait();
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
### ๐งฌ Cloning (EIP-1167) without factory
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
const clone = await deployer.deployClone(address);
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### ๐ UUPS Proxy
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
const proxy = await deployer.deployUUPS({
|
|
208
|
-
implementationAbi,
|
|
209
|
-
implementationBytecode,
|
|
210
|
-
initData
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
await proxy.write("setValue", 100);
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### CREATE2
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
const result = await deployer.deployCreate2({
|
|
220
|
-
factoryAddress: CREATE2_FACTORY,
|
|
221
|
-
abi: ERC20.abi,
|
|
222
|
-
bytecode: ERC20.bytecode,
|
|
223
|
-
salt,
|
|
224
|
-
args: ["My Token", "MTK", 18, 1000000]
|
|
225
|
-
});
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### ๐ฆ Library Linking
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
const lib = await deployer.deployWithLibraries({
|
|
232
|
-
abi: Calculator.abi,
|
|
233
|
-
bytecode: Calculator.bytecode,
|
|
234
|
-
linkReferences: {
|
|
235
|
-
"contracts/ryt/MathLib.sol": {
|
|
236
|
-
MathLib: [{ length: 20, start: 283 }]
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
libraries: {
|
|
240
|
-
MathLib: MATH_LIB_ADDRESS
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
## ๐จ Error Handling
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
try {
|
|
249
|
-
await contract.write("transfer", to, amount);
|
|
250
|
-
} catch (err) {
|
|
251
|
-
console.error(err);
|
|
252
|
-
}
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
## ๐ Feature Support
|
|
256
|
-
|
|
257
|
-
| Category | Feature | Status | Description |
|
|
258
|
-
|----------------------|------------------------|--------|-------------|
|
|
259
|
-
| Core | Provider | โ
| RPC connection & chain interaction layer |
|
|
260
|
-
| Core | Wallet | โ
| Private key management & signing |
|
|
261
|
-
| Core | Contract Read/Write | โ
| Unified smart contract interaction API |
|
|
262
|
-
| Tokens | ERC20 | โ
| Fungible token standard support |
|
|
263
|
-
| Tokens | ERC721 | โ
| NFT (non-fungible token) support |
|
|
264
|
-
| Tokens | ERC1155 | โ
| Multi-token standard support |
|
|
265
|
-
| Deployment | CREATE | โ
| Standard contract deployment |
|
|
266
|
-
| Deployment | CREATE2 | โ
| Deterministic contract deployment |
|
|
267
|
-
| Proxy Systems | UUPS Proxy | โ
| Upgradeable contract architecture |
|
|
268
|
-
| Proxy Systems | Cloning (EIP-1167) | โ
| Minimal proxy factory cloning |
|
|
269
|
-
| Advanced | Library Linking | โ
| Solidity library linking support |
|
|
270
|
-
| Advanced | Internal Transactions | โ
| Internal execution tracing support |
|
|
271
|
-
| Advanced | Payable Functions | โ
| ETH value transfer support |
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
## ๐งช Full Test Suite
|
|
275
|
-
|
|
276
|
-
To run tests, run the following command
|
|
73
|
+
To run tests, run the following commands:
|
|
277
74
|
|
|
278
75
|
```bash
|
|
279
76
|
npm test
|
|
280
77
|
npm run contractsTest
|
|
281
78
|
```
|
|
282
79
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
- ERC20 / ERC721 / ERC1155
|
|
286
|
-
- CREATE / CREATE2 deployments
|
|
287
|
-
- Proxy patterns (UUPS)
|
|
288
|
-
- Cloning (EIP-1167)
|
|
289
|
-
- Payable functions
|
|
290
|
-
- Library linking
|
|
291
|
-
- Internal transaction validation
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
## ๐ Why RYT SDK?
|
|
295
|
-
|
|
296
|
-
- ๐งฉ Modular blockchain architecture
|
|
297
|
-
- ๐๏ธ Supports advanced EVM patterns
|
|
298
|
-
- ๐ง Designed for real-world production systems
|
|
299
|
-
- ๐ Works with any EVM chain
|
|
300
|
-
|
|
301
|
-
## ๐ License
|
|
80
|
+
### ๐ License
|
|
302
81
|
|
|
303
|
-
[
|
|
82
|
+
[MIT](https://choosealicense.com/licenses/mit/)ยฉ 2026 RYT Core Team
|
|
304
83
|
|
|
305
84
|
|
|
306
|
-

|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ryt-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "RYT blockchain SDK for provider, wallet, and smart contract interactions",
|
|
6
6
|
"author": "Muhammad Hammad Mubeen",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,5 +57,13 @@
|
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/Hammad-Mubeen/ryt-sdk.git"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://ryt-docs.vercel.app",
|
|
66
|
+
"bugs": {
|
|
67
|
+
"url": "https://github.com/Hammad-Mubeen/ryt-sdk/issues"
|
|
60
68
|
}
|
|
61
69
|
}
|