ryt-sdk 1.0.1 โ 1.0.2
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 +9 -237
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
#### ๐ RYT SDK
|
|
2
2
|
|
|
3
3
|
RYT blockchain SDK for provider, wallet, and smart contract interactions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
#### โ๏ธ Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install ryt-sdk
|
|
@@ -13,7 +13,7 @@ or
|
|
|
13
13
|
yarn add ryt-sdk
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
#### ๐ Environment Setup
|
|
17
17
|
|
|
18
18
|
Create a .env file:
|
|
19
19
|
|
|
@@ -28,7 +28,7 @@ SALT=random_salt
|
|
|
28
28
|
MATH_LIB_ADDRESS=0xLibraryAddress
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
#### โก 30-Second Quickstart
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
import RYTProvider from "ryt-sdk/provider";
|
|
@@ -49,7 +49,7 @@ await tx.wait();
|
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
#### ๐ Overview
|
|
53
53
|
|
|
54
54
|
RYT SDK is a modular blockchain development toolkit designed to simplify:
|
|
55
55
|
|
|
@@ -61,246 +61,18 @@ RYT SDK is a modular blockchain development toolkit designed to simplify:
|
|
|
61
61
|
- Cloning (EIP-1167)
|
|
62
62
|
- Library-linked contracts
|
|
63
63
|
|
|
64
|
-
## ๐ง Architecture
|
|
65
64
|
|
|
66
|
-
|
|
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
|
-
|
|
155
|
-
### ๐๏ธ Deploy Contracts
|
|
156
|
-
|
|
157
|
-
```bash
|
|
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
|
-
```
|
|
65
|
+
#### ๐งช Testing
|
|
176
66
|
|
|
177
|
-
|
|
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
|
|
67
|
+
To run tests, run the following commands:
|
|
277
68
|
|
|
278
69
|
```bash
|
|
279
70
|
npm test
|
|
280
71
|
npm run contractsTest
|
|
281
72
|
```
|
|
282
73
|
|
|
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
|
|
74
|
+
#### ๐ License
|
|
302
75
|
|
|
303
|
-
[
|
|
76
|
+
[MIT](https://choosealicense.com/licenses/mit/)ยฉ 2026 RYT Core Team
|
|
304
77
|
|
|
305
78
|
|
|
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.2",
|
|
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
|
}
|