Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit ea54990

Browse files
author
cmd
committed
update
1 parent 71a5277 commit ea54990

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,32 @@ In terms of security, speed, and simplicity, we believe this is the best non-cus
245245

246246
This readme will be an mixture of documentation and links to code examples. The full documentation is still a work in progress.
247247

248-
Below is a step-by-step guide through the protocol.
248+
Below is a step-by-step guide through the protocol. This guide also includes a live demo that you can run yourself. To view the demo, simply clone this repository, then run the following commands:
249+
250+
```sh
251+
npm install # Install all package dependencies.
252+
npm run demo {chain} # Run the demo using the selected chain.
253+
```
254+
255+
> Note: The current chains available are `mutiny`, `signet`, and `testnet`. The default chain is `mutiny`.
256+
257+
Read more info about the demo [here](demo/README.md).
249258

250259
### Create a Client
251260

261+
252262
```ts
253263
import { EscrowClient } from '@scrow/core/client'
254264

255265
const config = {
266+
// The URL to our escrow server.
256267
hostname : 'https://bitescrow-signet.vercel.app',
268+
// The URL to an electrum-based indexer (your choice).
257269
oracle : 'https://mempool.space/signet',
270+
// The network you are using.
258271
network : 'signet'
259272
}
260273

261-
// Create a new client.
262274
export const client = new EscrowClient(config)
263275
```
264276

@@ -281,8 +293,6 @@ const signer_config = {
281293
export const signer = new EscrowSigner(signer_config)
282294
```
283295

284-
> Code example: [02_create_signer](demo/02_create_signer.ts)
285-
286296
### Build a Proposal
287297

288298
```ts
@@ -326,8 +336,6 @@ const roles = {
326336
}
327337

328338
```
329-
> Code example: [03_create_proposal](demo/03_create_proposal.ts)
330-
331339

332340
### Roles and Endorsements
333341

@@ -346,7 +354,6 @@ const signatures = signers.map(mbr => {
346354

347355
export { proposal, signatures }
348356
```
349-
> Code example: [04_roles_and_endorse](demo/04_roles_and_endorse.ts)
350357

351358
### Create a Contract
352359

@@ -358,7 +365,6 @@ if (!res.ok) throw new Error(res.error)
358365
export const { contract } = res.data
359366
```
360367

361-
> Code example: [05_create_contract](demo/05_create_contract.ts)
362368

363369
### Request a Deposit Account
364370

@@ -374,8 +380,6 @@ if (!res.ok) throw new Error(res.error)
374380
export const { account } = res.data
375381
```
376382

377-
> Code example: [06_request_account](demo/06_request_account.ts)
378-
379383
### Deposit funds into a Contract
380384

381385
```ts
@@ -399,8 +403,6 @@ if (!res.ok) throw new Error('failed')
399403
export const { contract, deposit } = res.data
400404
```
401405

402-
> Code example: [07_deposit_funds](demo/07_deposit_funds.ts)
403-
404406
### Monitor a Contract
405407

406408
```ts
@@ -415,8 +417,6 @@ if (contract.activated === null) {
415417
}
416418
```
417419

418-
> Code example: [08_check_contract](demo/08_check_contract.ts)
419-
420420
### Settle a Contract
421421

422422
```ts
@@ -445,8 +445,6 @@ if (!res.ok) throw new Error(res.error)
445445
export const settled_contract = res.data.contract
446446
```
447447

448-
> Code example: [09_settle_contract](demo/09_settle_contract.ts)
449-
450448
### API Demo
451449

452450
Documentation coming soon!

demo/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Protocol Demo
2+
3+
To view the demo, simply clone this repository, then run the following commands:
4+
5+
```sh
6+
npm install # Install all package dependencies.
7+
npm run demo {chain} # Run the demo using the selected chain.
8+
```
9+
10+
> Note: The current chains available are `mutiny`, `signet`, and `testnet`. The default chain is `mutiny`.
11+
12+
The demo will execute step-by-step, and print the communication between client and server to the console.
13+
14+
At certain points, the demo will pause and wait for transactions to confirm on the blockchain. Depending on the chain you select, this could take some time!
15+
16+
If you have any issues with the demo, please submit an issue ticket and let us know!

0 commit comments

Comments
 (0)