Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Mar 4, 2024
1 parent b5851bb commit 5b79d66
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
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.4",
"@cmdcode/nostr-sdk": "^0.0.6",
"@cmdcode/signer": "1.4.2",
"@scrow/tapscript": "2.2.2",
"zod": "^3.22.4"
Expand Down
11 changes: 7 additions & 4 deletions src/client/class/draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class DraftSession extends EventEmitter <{
'debug' : unknown[]
'endorse' : string
'error' : [ unknown, unknown ]
'fetch' : DraftSession
'full' : DraftSession
'info' : unknown[]
'join' : MemberData
Expand Down Expand Up @@ -108,6 +109,8 @@ export class DraftSession extends EventEmitter <{
this._full = false
this._init = false

this._room.on('fetch', () => { void this.emit('fetch', this) })

this._room.on('ready', () => {
this._init = true
this.emit('ready', this)
Expand Down Expand Up @@ -468,6 +471,10 @@ export class DraftSession extends EventEmitter <{
this.log.info('send endorse :', signer.pubkey)
}

async fetch () {
return this._room.fetch()
}

get_policy (pol_id : string) {
const pol = this.roles.find(e => e.id === pol_id)
if (pol === undefined) throw new Error('policy does not exist: ' + pol_id)
Expand Down Expand Up @@ -556,10 +563,6 @@ export class DraftSession extends EventEmitter <{
return contract
}

async refresh () {
return this._room._store.fetch()
}

update_terms (terms : Partial<ProposalData>) {
if (!this.check_terms(terms)) {
throw new Error('invalid terms: ' + terms.toString())
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.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==
"@cmdcode/nostr-sdk@^0.0.6":
version "0.0.6"
resolved "https://registry.yarnpkg.com/@cmdcode/nostr-sdk/-/nostr-sdk-0.0.6.tgz#6a70b76a769fbc1f9827f5321f281ea60753cc9d"
integrity sha512-bF5SHMBxALd4akGB+a+QXJXzSh+6yHQJnkdNCi4GynwehapVfgT9Gj4rcOypYOOMQW/o0mOCjTUpUkw22emPWQ==
dependencies:
"@cmdcode/buff" "2.2.5"
"@cmdcode/crypto-tools" "2.7.6"
Expand Down

0 comments on commit 5b79d66

Please sign in to comment.