Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Feb 23, 2024
1 parent 4d14ad1 commit fa2d26e
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 10 deletions.
10 changes: 9 additions & 1 deletion demo/api/contract/cancel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/cancel
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/cancel
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { moderator as signer } from '@scrow/demo/03_build_proposal.js'
import { moderator as signer } from '@scrow/demo/03_create_draft.js'
import { new_contract } from '@scrow/demo/05_create_contract.js'

// Define the contract id we will cancel.
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/create.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/create
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/create
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { draft } from '@scrow/demo/04_finish_draft.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/digest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/digest
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/digest
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { new_contract } from '@scrow/demo/05_create_contract.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/funds.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/funds
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/funds
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { funded_contract } from '@scrow/demo/07_deposit_funds.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/list.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/list
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/list
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { signers } from '@scrow/demo/02_create_signer.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/read.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/read
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/read
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { new_contract } from '@scrow/demo/05_create_contract.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/status.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/status
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/status
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { new_contract } from '@scrow/demo/05_create_contract.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/submit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/submit
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/submit
*/

import { print_banner } from '@scrow/test'
import { WitnessData } from '@scrow/core'
import { client } from '@scrow/demo/01_create_client.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/vmstate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/vmstate
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/vmstate
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { active_contract } from '@scrow/demo/08_check_contract.js'
Expand Down
8 changes: 8 additions & 0 deletions demo/api/contract/witness.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Contract API Demo for endpoint:
* /api/contract/:cid/witness
*
* You can run this demo using the shell command:
* yarn load demo/api/contract/witness
*/

import { print_banner } from '@scrow/test'
import { client } from '@scrow/demo/01_create_client.js'
import { settled_contract } from '@scrow/demo/09_settle_contract.js'
Expand Down
18 changes: 9 additions & 9 deletions docs/api/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if (!res.ok) throw new Error(res.error)
const new_contract = res.data.contract
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/create`
**Example Response**
Expand Down Expand Up @@ -120,7 +120,7 @@ if (!res.ok) throw new Error(res.error)
const contracts = res.data.contracts
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/list`
**Example Response**
Expand Down Expand Up @@ -168,7 +168,7 @@ if (!res.ok) throw new Error(res.error)
const contract = res.data.contract
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/read`
**Example Response**
Expand Down Expand Up @@ -220,7 +220,7 @@ if (!res.ok) throw new Error(res.error)
const canceled_contract = res.data.contract
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/cancel`
**Example Response**
Expand Down Expand Up @@ -268,7 +268,7 @@ if (!res.ok) throw new Error(res.error)
const contract = res.data.contract
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/digest`
**Example Response**
Expand Down Expand Up @@ -319,7 +319,7 @@ if (!res.ok) throw new Error(res.error)
const status = res.data.contract
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/status`
**Example Response**
Expand Down Expand Up @@ -392,7 +392,7 @@ if (!res.ok) throw new Error(res.error)
const updated_contract = res.data.contract
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/submit`
**Example Response**
Expand Down Expand Up @@ -443,7 +443,7 @@ if (!res.ok) throw new Error(res.error)
const vm_state = res.data.vm_state
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/vmstate`
**Example Response**
Expand Down Expand Up @@ -492,7 +492,7 @@ if (!res.ok) throw new Error(res.error)
const statements = res.data.statements
```

> You can run this in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using:
> You can run this code in our live [replit instance](https://replit.com/@cscottdev/escrow-core) using the shell command:
> `yarn load demo/api/contract/witness`
**Example Response**
Expand Down

0 comments on commit fa2d26e

Please sign in to comment.