Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Feb 1, 2024
1 parent b84efb2 commit 8952e5e
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/api/deposit.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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**

Expand Down
8 changes: 4 additions & 4 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
11 changes: 0 additions & 11 deletions docs/interfaces/deposit.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,3 @@ type DepositStatus =
'expired' |
'error'
```
## TxOutput
```ts
interface TxOutput {
txid : string,
vout : number,
value : number,
scriptkey : string
}
```
79 changes: 79 additions & 0 deletions docs/interfaces/oracle.md
Original file line number Diff line number Diff line change
@@ -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
}
```
41 changes: 41 additions & 0 deletions docs/servers.md
Original file line number Diff line number Diff line change
@@ -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'
}
```

0 comments on commit 8952e5e

Please sign in to comment.