diff --git a/packages/api/src/bindings.d.ts b/packages/api/src/bindings.d.ts index e3d069670c..18055776df 100644 --- a/packages/api/src/bindings.d.ts +++ b/packages/api/src/bindings.d.ts @@ -7,6 +7,7 @@ import { UserOutput, UserOutputKey } from './utils/db-client-types.js' import { DBClient } from './utils/db-client.js' import { LinkdexApi } from './utils/linkdex.js' import { Logging } from './utils/logs.js' +import { Client as W3upClient } from '@web3-storage/w3up-client' export type RuntimeEnvironmentName = 'test' | 'dev' | 'staging' | 'production' @@ -99,6 +100,12 @@ export interface ServiceConfiguration { /** w3up connection URL (e.g. https://up.web3.storage) */ W3UP_URL?: string + + /** base64 encoded multiformats ed25519 secretKey */ + W3_NFTSTORAGE_PRINCIPAL?: string + + /** CID (identity codec) of CAR-encoded UCAN DAG */ + W3_NFTSTORAGE_PROOF?: string } export interface Ucan { @@ -132,6 +139,7 @@ export interface RouteContext { ucanService: Service auth?: Auth W3UP_URL?: string + w3up?: W3upClient } export type Handler = ( diff --git a/packages/api/test/nfts-upload.spec.js b/packages/api/test/nfts-upload.spec.js index c1ef8de7c0..ee59afc840 100644 --- a/packages/api/test/nfts-upload.spec.js +++ b/packages/api/test/nfts-upload.spec.js @@ -973,9 +973,9 @@ async function createListeningMockW3up() { server.addListener('listening', () => resolve(undefined)) }) const serverAddress = server.address() - if (typeof serverAddress === 'string') + if (typeof serverAddress === 'string' || !serverAddress) throw new Error('server.address() must not return a string') - const url = new URL(`http://localhost:${serverAddress?.port ?? ''}`) + const url = new URL(`http://localhost:${serverAddress.port}`) return { get requestCount() { return requestCount