From fa2d26ed2a042a91ee6e4d02327200e6abd96f5f Mon Sep 17 00:00:00 2001 From: cmd Date: Fri, 23 Feb 2024 01:06:31 -0600 Subject: [PATCH] update --- demo/api/contract/cancel.ts | 10 +++++++++- demo/api/contract/create.ts | 8 ++++++++ demo/api/contract/digest.ts | 8 ++++++++ demo/api/contract/funds.ts | 8 ++++++++ demo/api/contract/list.ts | 8 ++++++++ demo/api/contract/read.ts | 8 ++++++++ demo/api/contract/status.ts | 8 ++++++++ demo/api/contract/submit.ts | 8 ++++++++ demo/api/contract/vmstate.ts | 8 ++++++++ demo/api/contract/witness.ts | 8 ++++++++ docs/api/contract.md | 18 +++++++++--------- 11 files changed, 90 insertions(+), 10 deletions(-) diff --git a/demo/api/contract/cancel.ts b/demo/api/contract/cancel.ts index 2af0ad2b..43135d74 100644 --- a/demo/api/contract/cancel.ts +++ b/demo/api/contract/cancel.ts @@ -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. diff --git a/demo/api/contract/create.ts b/demo/api/contract/create.ts index d85d9c56..7e46a6f0 100644 --- a/demo/api/contract/create.ts +++ b/demo/api/contract/create.ts @@ -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' diff --git a/demo/api/contract/digest.ts b/demo/api/contract/digest.ts index 06501e50..79831c2b 100644 --- a/demo/api/contract/digest.ts +++ b/demo/api/contract/digest.ts @@ -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' diff --git a/demo/api/contract/funds.ts b/demo/api/contract/funds.ts index f9681fef..e0c1121c 100644 --- a/demo/api/contract/funds.ts +++ b/demo/api/contract/funds.ts @@ -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' diff --git a/demo/api/contract/list.ts b/demo/api/contract/list.ts index ccb678c2..2b130993 100644 --- a/demo/api/contract/list.ts +++ b/demo/api/contract/list.ts @@ -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' diff --git a/demo/api/contract/read.ts b/demo/api/contract/read.ts index 6cf0fe62..ce187a5a 100644 --- a/demo/api/contract/read.ts +++ b/demo/api/contract/read.ts @@ -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' diff --git a/demo/api/contract/status.ts b/demo/api/contract/status.ts index fb6c455e..5716ab7a 100644 --- a/demo/api/contract/status.ts +++ b/demo/api/contract/status.ts @@ -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' diff --git a/demo/api/contract/submit.ts b/demo/api/contract/submit.ts index 2151d7be..3638c09a 100644 --- a/demo/api/contract/submit.ts +++ b/demo/api/contract/submit.ts @@ -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' diff --git a/demo/api/contract/vmstate.ts b/demo/api/contract/vmstate.ts index 3a45479a..c49bd413 100644 --- a/demo/api/contract/vmstate.ts +++ b/demo/api/contract/vmstate.ts @@ -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' diff --git a/demo/api/contract/witness.ts b/demo/api/contract/witness.ts index b59e25e4..83fd3cd2 100644 --- a/demo/api/contract/witness.ts +++ b/demo/api/contract/witness.ts @@ -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' diff --git a/docs/api/contract.md b/docs/api/contract.md index 8dfd63b1..f5544ac1 100644 --- a/docs/api/contract.md +++ b/docs/api/contract.md @@ -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** @@ -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** @@ -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** @@ -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** @@ -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** @@ -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** @@ -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** @@ -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** @@ -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**