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
final client = QueryClient("wss://tfchain.dev.grid.tf/ws");
19
-
client.connect();
19
+
await client.connect();
20
20
final contract = await client.contracts.get(contractId: BigInt.from(123456));
21
21
print(contract!.toJson());
22
-
client.disconnect();
22
+
await client.disconnect();
23
23
```
24
24
25
25
### Full Client
26
26
27
27
```dart
28
-
final client = Client("wss://tfchain.dev.grid.tf/ws", "your-mnemonic");
28
+
final client = Client("wss://tfchain.dev.grid.tf/ws", "your-mnemonic", "sr25519");
29
29
client.connect();
30
-
final extrinsic = await client.clientFarms.create(CreateFarmOptions(name: "name"));
31
-
await client.apply(extrinsic);
32
-
client.disconnect();
30
+
final farmId = await client.farma.create(CreateFarmOptions(name: "name"));
31
+
print(farmId);
32
+
await client.disconnect();
33
33
```
34
34
35
35
## Run Tests
36
+
### Prerequisites
37
+
38
+
1- Provide your mnemonic as environment variable.
39
+
```bash
40
+
export MNEMONIC="your-mnemonic"
41
+
```
42
+
2- provide chain url and the signing type.
43
+
By default the chain url is set to `wss://tfchain.dev.grid.tf/ws` and the signing type is `sr25519`. Note that signing type can be either `sr25519` or `ed25519`.
0 commit comments