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: README.md
+73-2Lines changed: 73 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,6 @@ To add a wallet, you can do the following:
88
88
89
89
```sh
90
90
cargo run -- wallet create
91
-
92
91
```
93
92
94
93
This will prompt you for a a name and a password. Keep in mind that losing the
@@ -102,8 +101,80 @@ cargo run -- provider create
102
101
103
102
This will prompt you for a name, a kind (only UTxORPC supported), whether it is for mainnet or testnet, a URL and the possibility to add headers.
104
103
105
-
>>> If you have a [Demeter](https://demeter.run) port you would have to set the URL as `https://{host}` and on put `dmtr-api-key:YOUR_API_KEY` on the headers.
104
+
> If you have a [Demeter](https://demeter.run) port you would have to set the URL as `https://{host}` and on put `dmtr-api-key:YOUR_API_KEY` on the headers.
105
+
106
+
# Examples
107
+
108
+
In the `examples` folder you can find scripts demonstrating advanced capabilities.
109
+
110
+
## Batch transactions
111
+
112
+
This example shows how to send transactions to multiple recipients in a batch.
-`sender_wallet`: Name of the wallet sending the funds (e.g., `alice`)
146
+
-`receiver_wallet`: Name of the recipient wallet (e.g., `bob`)
147
+
-`lovelace_amount`: Amount in lovelaces to send (e.g., `1000000`)
148
+
-`cron_string`: Cron schedule expression in the format `'minute hour day month weekday'`
149
+
150
+
**Example:**
151
+
```sh
152
+
./transfer.sh alice bob 1000000 '0 */2 * * *'
153
+
```
154
+
155
+
This will schedule a transfer of 1,000,000 lovelaces from Alice to Bob every 2 hours.
156
+
157
+
## Complex transaction
158
+
159
+
This example shows how to interact with a protocol that requires several parameters, specifically creating a ship in [Asteria](https://asteria.txpipe.io).
160
+
161
+
**Location:**`examples/complex-transaction/`
162
+
163
+
**Usage:**
164
+
```sh
165
+
./create-ship.sh <player_wallet><pos_x><pos_y>
166
+
```
167
+
168
+
**Arguments:**
169
+
-`player_wallet`: Name of the player's wallet (e.g., `alice`)
170
+
-`pos_x`: X coordinate for the ship position (integer)
171
+
-`pos_y`: Y coordinate for the ship position (integer)
172
+
173
+
**Example:**
174
+
```sh
175
+
./create-ship.sh alice 25 25
176
+
```
108
177
178
+
This will create a new ship for Alice at coordinates (25, 25) in [Asteria](https://asteria.txpipe.io).
109
179
180
+
> Note: you need to use a provider with the Cardano preview testnet in order to submit this transaction
-`sender_wallet`: Name of the wallet sending the funds (e.g., `alice`)
45
+
-`receiver_wallet`: Name of the recipient wallet (e.g., `bob`)
46
+
-`lovelace_amount`: Amount in lovelaces to send (e.g., `1000000`)
47
+
-`cron_string`: Cron schedule expression in the format `'minute hour day month weekday'`
48
+
49
+
**Example:**
50
+
```sh
51
+
./transfer.sh alice bob 1000000 '0 */2 * * *'
52
+
```
53
+
54
+
This will schedule a transfer of 1,000,000 lovelaces from Alice to Bob every 2 hours.
55
+
56
+
## Complex transaction
57
+
58
+
This example shows how to interact with a protocol that requires several parameters, specifically creating a ship in [Asteria](https://asteria.txpipe.io).
0 commit comments