Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Jan 26, 2024
1 parent 24762a6 commit 435a100
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ The members must first negotiate and agree on a [proposal](docs/proposal.md) doc

If desired, a third-party can host the proposal. The protocol is designed for third-parties to help with negotiation, and offer their own services such as arbitration.

There is no specification placed on how to communicate the proposal between parties. There are so many great communication protocols that exist in the wild, and they virtually all support JSON, so feel free to use your favorite one!
There is no specification placed on how to communicate the proposal between parties. There are many great protocols available, so feel free to use your favorite one!

> Note: The server `agent` does not take part in negotiations. While BitEscrow may offer these services, the protocol is designed so that members and third-parties can negotiate freely, without the agent being involved.
> Note: The server agent does not take part in negotiations. While BitEscrow may offer these services, the protocol is designed so that members and third-parties can negotiate freely, without the agent being involved.
### Funding

Expand Down
7 changes: 2 additions & 5 deletions src/client/api/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import { parse_proposal } from '@/lib/parse.js'
import { verify_proposal } from '@/validators/index.js'

import {
ApiResponse,
ContractDataResponse,
ContractListResponse,
DepositListResponse,
WitnessListResponse
} from '@/client/types.js'

import {
ApiResponse,
WitnessListResponse,
ProposalData,
WitnessData
} from '@/types/index.js'
Expand Down
11 changes: 4 additions & 7 deletions src/client/api/deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import { EscrowClient } from '../class/client.js'
import { validate_registration } from '@/validators/index.js'

import {
CovenantData,
ReturnData,
ApiResponse,
DepositRequest,
AccountDataResponse,
DepositDataResponse,
DepositListResponse,
FundingDataResponse
} from '@/client/types.js'

import {
CovenantData,
ReturnData,
ApiResponse,
DepositRequest
} from '@/types/index.js'

import * as assert from '@/assert.js'
Expand Down
3 changes: 1 addition & 2 deletions src/client/api/depositor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@/lib/session.js'

import {
AccountDataResponse,
ApiResponse,
ContractData,
CovenantData,
Expand All @@ -18,8 +19,6 @@ import {
TxOutput
} from '@/types/index.js'

import { AccountDataResponse } from '../types.js'

export function request_account_api (client : EscrowSigner) {
return async (
locktime : number
Expand Down
9 changes: 6 additions & 3 deletions src/client/api/wid.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { EscrowClient } from '../class/client.js'
import { WitnessDataResponse } from '../types.js'
import { ApiResponse } from '../../types/index.js'
import { EscrowClient } from '../class/client.js'

import {
ApiResponse,
WitnessDataResponse
} from '@/types/index.js'

import * as assert from '@/assert.js'

Expand Down
37 changes: 0 additions & 37 deletions src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { ZodTypeAny } from 'zod'

import {
CredSignerAPI,
ContractData,
DepositAccount,
DepositData,
MemberData,
WalletAPI,
WitnessData
} from '@/types/index.js'

export interface ClientConfig {
Expand Down Expand Up @@ -35,36 +31,3 @@ export interface Membership {
signer : CredSignerAPI,
wallet : WalletAPI
}

export interface AccountDataResponse {
account : DepositAccount
}

export interface ContractDataResponse {
contract : ContractData
}

export interface ContractListResponse {
contracts : ContractData[]
}

export interface DepositDataResponse {
deposit : DepositData
}

export interface DepositListResponse {
deposits : DepositData[]
}

export interface WitnessDataResponse {
witness : WitnessData
}

export interface WitnessListResponse {
witnesses : WitnessData[]
}

export interface FundingDataResponse {
contract : ContractData
deposit : DepositData
}
41 changes: 41 additions & 0 deletions src/types/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import { ContractData } from './contract.js'
import { WitnessData } from './program.js'

import {
DepositAccount,
DepositData
} from './deposit.js'

export type ApiResponse<T> = DataResponse<T> | ErrorResponse

export interface DataResponse<T> {
Expand All @@ -12,3 +20,36 @@ export interface ErrorResponse {
error : string
status : number
}

export interface AccountDataResponse {
account : DepositAccount
}

export interface ContractDataResponse {
contract : ContractData
}

export interface ContractListResponse {
contracts : ContractData[]
}

export interface DepositDataResponse {
deposit : DepositData
}

export interface DepositListResponse {
deposits : DepositData[]
}

export interface WitnessDataResponse {
witness : WitnessData
}

export interface WitnessListResponse {
witnesses : WitnessData[]
}

export interface FundingDataResponse {
contract : ContractData
deposit : DepositData
}

0 comments on commit 435a100

Please sign in to comment.