Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Mar 12, 2024
1 parent 9915850 commit 10c00c7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions demo/api/deposit/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const depositor = signers[0]
// Define our deposit locktime.
const locktime = 60 * 60 // 1 hour locktime
// Get an account request from the funder device.
const acct_req = depositor.account.create(locktime)
const acct_req = depositor.account.create(locktime, 1234)
// Submit the account request to the server
const acct_res = await client.deposit.request(acct_req)
const acct_res = await client.deposit.request(acct_req)
// Check the response is valid.
if (!acct_res.ok) throw new Error(acct_res.error)
// Unpack our data response.
Expand Down
3 changes: 1 addition & 2 deletions src/client/api/signer/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export function create_account_api (signer : EscrowSigner) {
index = index ?? signer._gen_idx()
const deposit_pk = signer.pubkey
const spend_xpub = signer.wallet.get(index).xpub
const stamp = index
return { deposit_pk, locktime, spend_xpub, stamp }
return { deposit_pk, locktime, spend_xpub }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/class/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class EscrowSigner {
const signer = new Signer({ seed })
const wallet = (xpub !== undefined)
? new Wallet(xpub)
: Wallet.generate({ seed, network : config.network as Network })
: Wallet.create({ seed, network : config.network as Network })
return new EscrowSigner({ ...config, signer, wallet })
}

Expand Down
3 changes: 1 addition & 2 deletions src/schema/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import depo from './deposit.js'
import prop from './proposal.js'
import tx from './tx.js'

const { hash, hex, nonce, num, stamp, str } = base
const { hash, hex, nonce, num, str } = base
const { covenant, locktime } = depo
const { txspend } = tx

Expand All @@ -19,7 +19,6 @@ const deposit_acct_req = z.object({
deposit_pk : hash,
locktime : locktime.optional(),
spend_xpub : str,
stamp : stamp.optional()
})

const deposit_register_req = z.object({
Expand Down
1 change: 0 additions & 1 deletion src/types/api/deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface AccountRequest {
deposit_pk : string
locktime ?: number
spend_xpub : string
stamp ?: number
}

export interface RegisterRequest {
Expand Down

0 comments on commit 10c00c7

Please sign in to comment.