Skip to content

Commit

Permalink
feat: Use latest client (@storacha/client) (#650)
Browse files Browse the repository at this point in the history
This should fix uploads in non-prod environments (a fix which was
applied in the new client, but not the old one).
  • Loading branch information
Peeja authored Dec 4, 2024
1 parent 835ea5a commit 9f4e0d9
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 94 deletions.
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 9f4e0d9

Please sign in to comment.