From 8952e5eefa1741f107ce9153555ff57a6540549d Mon Sep 17 00:00:00 2001 From: cmd Date: Thu, 1 Feb 2024 16:53:07 -0600 Subject: [PATCH] update --- docs/api/deposit.md | 4 +- docs/client.md | 8 ++-- docs/interfaces/deposit.md | 11 ------ docs/interfaces/oracle.md | 79 ++++++++++++++++++++++++++++++++++++++ docs/servers.md | 41 ++++++++++++++++++++ 5 files changed, 126 insertions(+), 17 deletions(-) create mode 100644 docs/interfaces/oracle.md create mode 100644 docs/servers.md diff --git a/docs/api/deposit.md b/docs/api/deposit.md index fb9b30a1..2f54d7e6 100644 --- a/docs/api/deposit.md +++ b/docs/api/deposit.md @@ -57,7 +57,7 @@ Register a utxo in the blockchain/mempool with a deposit account. Related interfaces: - [DepositData](../interfaces/deposit.md#depositdata) -- [TxOutput](../interfaces/deposit.md#txoutput) +- [TxOutput](../interfaces/oracle.md#txoutput) **Request Format** @@ -99,7 +99,7 @@ Related interfaces: - [ContractData](../interfaces/contract.md#contractdata) - [CovenantData](../interfaces/deposit.md#covenantdata) - [DepositData](../interfaces/deposit.md#depositdata) -- [TxOutput](../interfaces/deposit.md#txoutput) +- [TxOutput](../interfaces/oracle.md#txoutput) **Request Format** diff --git a/docs/client.md b/docs/client.md index ad2e26b7..15948174 100644 --- a/docs/client.md +++ b/docs/client.md @@ -38,14 +38,14 @@ const client = new EscrowClient(client_config) We have an escrow server running for `signet`, `testnet` and `mutinynet`. -To see an updated list of our servers that you can connect to, [click here.](../demo/00_demo_config.ts) +To see an updated list of our servers that you can connect to, [click here](./servers.md). ## Selecting an Oracle An oracle server is used to fetch information about the blockchain. -The OracleAPI is based on the electrum API specification, so any electrum-based server API should work as an oracle server. +The Oracle API is based on the electrum API specification, so any electrum-based server API should work as an oracle server. -To see a recommended list of oracles to use, [click here.](../demo/00_demo_config.ts) +To see a recommended list of oracles to use, [click here.](./servers.md) -To see a complete list of interfaces for the OracleAPI, [click here.](../src/types/oracle.ts) +To see a complete list of interfaces for the Oracle API, [click here](./interfaces/oracle.md). diff --git a/docs/interfaces/deposit.md b/docs/interfaces/deposit.md index 652a8057..bd505060 100644 --- a/docs/interfaces/deposit.md +++ b/docs/interfaces/deposit.md @@ -102,14 +102,3 @@ type DepositStatus = 'expired' | 'error' ``` - -## TxOutput - -```ts -interface TxOutput { - txid : string, - vout : number, - value : number, - scriptkey : string -} -``` \ No newline at end of file diff --git a/docs/interfaces/oracle.md b/docs/interfaces/oracle.md new file mode 100644 index 00000000..ea9202b9 --- /dev/null +++ b/docs/interfaces/oracle.md @@ -0,0 +1,79 @@ +# Oracle Interfaces + +List of interfaces for the Oracle API. + +> Click on the links below to navigate: + +- [OracleTxData](#oracletxdata) +- [OracleSpendData](#oraclespenddata) +- [OracleTxOutput](#txoutput) + +## OracleTxData + +```ts +interface OracleTxData { + txid : string + version : number, + locktime : number + vin : OracleTxIn[] + vout : OracleTxOut[] + size : number + weight : number + fee : number + status : OracleTxStatus +} + +interface OracleTxIn { + txid : string + vout : number + prevout : OracleTxOut | null + scriptsig : string + scriptsig_asm : string + witness : string[] + sequence : number + is_coinbase : boolean +} + +interface OracleTxOut { + scriptpubkey : string + scriptpubkey_asm : string + scriptpubkey_type : string + scriptpubkey_address ?: string + value : number +} + +interface OracleTxStatus { + confirmed : boolean + block_hash : string | null + block_height : number | null + block_time : number | null +} +``` + +## OracleSpendData + +```ts +interface OracleSpendData { + txspend : TxOutput + status : OracleTxStatus + state : OracleSpendState +} + +interface OracleTxSpendState { + spent : boolean + txid : string | null + vin : number | null + status : OracleTxStatus +} +``` + +## TxOutput + +```ts +interface TxOutput { + txid : string, + vout : number, + value : number, + scriptkey : string +} +``` \ No newline at end of file diff --git a/docs/servers.md b/docs/servers.md new file mode 100644 index 00000000..b063c001 --- /dev/null +++ b/docs/servers.md @@ -0,0 +1,41 @@ +# Server Docs + +## Connecting to our Server + +BitEscrow currently provides an escrow server for the `signet`, `testnet`, and `mutiny` networks. Check out our list of client configurations below. + +### Mutiny Configuration + +To connect your EscrowClient to our `mutiny` server, use the following config: + +```ts +const config = { + hostname : 'https://bitescrow-mutiny.vercel.app', + oracle : 'https://mutinynet.com', + network : 'mutiny' +} +``` + +### Signet Configuration + +To connect your EscrowClient to our `signet` server, use the following config: + +```ts +const config = { + hostname : 'https://bitescrow-signet.vercel.app', + oracle : 'https://mempool.space/signet', + network : 'signet' +} +``` + +### Testnet Configuration + +To connect your EscrowClient to our `testnet` server, use the following config: + +```ts +const config = { + hostname : 'https://bitescrow-testnet.vercel.app', + oracle : 'https://mempool.space/testnet', + network : 'testnet' +} +```