Skip to content

Commit

Permalink
v0.7.22
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Mar 4, 2024
1 parent 3a0e169 commit fd1ba01
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
10 changes: 1 addition & 9 deletions demo/draft/alice/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ import { signer } from './config.js'

console.log(signer.pubkey)

const session = new DraftSession(signer, {
socket_config : { verbose : true, debug : true },
store_config : { verbose : true, debug : false },
verbose : true
})

const drafts = await session.list('wss://relay.damus.io')
const drafts = await DraftSession.list('wss://relay.damus.io', signer, { verbose : true })

console.dir(drafts, { depth : null })

session.delete(drafts[0].store_id)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrow/core",
"version": "0.7.21",
"version": "0.7.22",
"description": "Core library for BitEscrow API.",
"author": "Christopher Scott",
"license": "MIT",
Expand Down Expand Up @@ -122,7 +122,7 @@
"@cmdcode/buff": "2.2.5",
"@cmdcode/crypto-tools": "2.7.6",
"@cmdcode/musig2": "2.4.3",
"@cmdcode/nostr-sdk": "^0.0.3",
"@cmdcode/nostr-sdk": "^0.0.4",
"@cmdcode/signer": "1.4.2",
"@scrow/tapscript": "2.2.2",
"zod": "^3.22.4"
Expand Down
7 changes: 5 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ export default {
format: 'iife',
name: 'escrow_core',
plugins: [terser()],
sourcemap: true
sourcemap: true,
globals : {
'ws' : 'WebSocket'
}
}
],
external : ['websocket'],
external : ['ws'],
plugins: [ typescript(), nodeResolve(), commonjs() ],
strictDeprecations: true,
treeshake
Expand Down
12 changes: 11 additions & 1 deletion src/client/class/draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { EventEmitter } from './emitter.js'
import { EscrowSigner } from './signer.js'
import { EscrowContract } from './contract.js'
import { EscrowClient } from './client.js'
import { DraftItem } from '../types.js'

import {
EventMessage,
NostrRoom
NostrRoom,
SocketConfig
} from '@cmdcode/nostr-sdk'

import {
Expand Down Expand Up @@ -76,6 +78,14 @@ export class DraftSession extends EventEmitter <{
'published' : string
}> {

static async list (
address : string,
signer : EscrowSigner,
options ?: Partial<SocketConfig>
) : Promise<DraftItem[]> {
return NostrRoom.list(address, signer._signer, undefined, options)
}

readonly _opt : SessionConfig
readonly _signer : EscrowSigner
readonly _room : NostrRoom<DraftData>
Expand Down
2 changes: 1 addition & 1 deletion src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export interface FetchConfig {

export interface DraftItem {
pubkey : string,
id : string,
secret : string,
store_id : string,
topic_id : string,
updated_at : number
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"@cmdcode/buff" "^2.2.5"
"@cmdcode/crypto-tools" "^2.7.6"

"@cmdcode/nostr-sdk@^0.0.3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@cmdcode/nostr-sdk/-/nostr-sdk-0.0.3.tgz#0681c0afb6eb634aa63ff89481c87997afb939c1"
integrity sha512-qTMz2x+OXcHrD/hXmRVc3G4OKiMpwf1/7CqzRk4tqh8xxe3ei0kMt7xlyaiOENEe34pNY6p1FoldoKz7m43fNA==
"@cmdcode/nostr-sdk@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cmdcode/nostr-sdk/-/nostr-sdk-0.0.4.tgz#6c50456444a8ec7fc9a65333849c77bee1b3a07a"
integrity sha512-mG9FK1X0pupdgUJywH/gETvWbALuylcE7DKaqH6Mt76dBDletgKik84Vn6DVHMH1dX4UZMeID/PWSU6E1BCi/w==
dependencies:
"@cmdcode/buff" "2.2.5"
"@cmdcode/crypto-tools" "2.7.6"
Expand Down

0 comments on commit fd1ba01

Please sign in to comment.