Skip to content

Commit

Permalink
feat: Use latest client (@storacha/client)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeja committed Dec 4, 2024
1 parent 835ea5a commit d3f456c
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 95 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"license": "Apache-2.0 OR MIT",
"packageManager": "[email protected]+sha256.56a9e76b51796ca7f73b85e44cf83712862091f4d498c0ce4d5b7ecdc6ba18f7",
"scripts": {
"prepare": "pnpm run build && pnpm run compile",
"prepare-": "pnpm run build && pnpm run compile",
"build": "pnpm run --recursive --if-present build",
"dev": "pnpm run --filter './packages/*' --if-present --parallel dev",
"clean": "rm -rf node_modules coverage packages/*/{dist,build,node_modules}",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@ucanto/transport": "^9.1.1",
"@web3-storage/access": "^20.0.1",
"@web3-storage/did-mailto": "^2.1.0",
"@web3-storage/w3up-client": "16.2.0"
"@storacha/client": "1.0.5"
},
"eslintConfig": {
"extends": [
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { AgentDataExport } from '@web3-storage/access/types'
import type { ServiceConfig } from './service.js'

import { StoreIndexedDB } from '@web3-storage/access/stores/store-indexeddb'
import { Client, create as createW3UPClient } from '@web3-storage/w3up-client'
import { Account } from '@web3-storage/w3up-client/account'
import { Space } from '@web3-storage/w3up-client/space'
import { Client, create as createStorachaClient } from '@storacha/client'
import { Account } from '@storacha/client/account'
import { Space } from '@storacha/client/space'
import { createServiceConf } from './service.js'
import { Driver } from '@web3-storage/access/drivers/types'

export * from '@web3-storage/w3up-client/types'
export * from '@storacha/client/types'
export { Client, Account, Space, ServiceConfig }
export type Store = Driver<AgentDataExport>

Expand Down Expand Up @@ -73,6 +73,6 @@ export async function createClient (
const events = options?.events ?? new EventTarget()
const store = new IndexedDBEventDispatcherStore(dbName, events)
const serviceConf = createServiceConf(options)
const client = await createW3UPClient({ store, serviceConf, receiptsEndpoint: options?.receiptsEndpoint })
const client = await createStorachaClient({ store, serviceConf, receiptsEndpoint: options?.receiptsEndpoint })
return { client, events, store }
}
2 changes: 1 addition & 1 deletion packages/core/src/service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ServiceConf, Service } from '@web3-storage/w3up-client/types'
import type { ServiceConf, Service } from '@storacha/client/types'
import { connect } from '@ucanto/client'
import { CAR, HTTP } from '@ucanto/transport'
import type {
Expand Down
252 changes: 165 additions & 87 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3f456c

Please sign in to comment.