diff --git a/README.md b/README.md index 640ace7f..2e13e88f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ import Ardrive from '@ardrive/turbo-sdk/web'; The provided typings (`./lib/types/index.d.ts`) will be automatically recognized, offering type checking and autocompletion benefits. -# APIs +# APIs (WIP) ## TurboFactory diff --git a/package.json b/package.json index f23d60c7..bea1c3f9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "license": "AGPL-3.0-or-later", "scripts": { "build:web": "node bundle.cjs", - "build:esm": "yarn tsc -p tsconfig.node.json && cp package.json README.md LICENSE.md ./lib", + "build:esm": "yarn tsc -p tsconfig.node.json && yarn tsc -p tsconfig.web.json && cp package.json README.md LICENSE.md ./lib", "build": "yarn clean && yarn build:web && yarn build:esm", "clean": "rimraf [ lib coverage bundles ]", "postinstall": "husky install", diff --git a/src/web/signer.ts b/src/web/signer.ts index 8e076f23..89c245da 100644 --- a/src/web/signer.ts +++ b/src/web/signer.ts @@ -41,6 +41,7 @@ export class TurboWebArweaveSigner implements TurboWalletSigner { // TODO: converts the readable stream to a buffer bc incrementally signing ReadableStreams is not trivial const buffer = await readableStreamToBuffer({ stream: fileStreamFactory(), + // TODO: add payload size to get performance improvements }); const signedDataItem = createData(buffer, this.signer); await signedDataItem.sign(this.signer); @@ -49,7 +50,6 @@ export class TurboWebArweaveSigner implements TurboWalletSigner { // NOTE: this might be better in a parent class or elsewhere - easy enough to leave in here now and does require specific environment version of crypto async generateSignedRequestHeaders() { - // due to exports of SubtleCrypto - we need to import the module dynamically const nonce = randomBytes(16).toString('hex'); const buffer = Buffer.from(nonce); const signature = await Arweave.default.crypto.sign( diff --git a/tsconfig.web.json b/tsconfig.web.json index dfe35fd4..c58d0b01 100644 --- a/tsconfig.web.json +++ b/tsconfig.web.json @@ -1,7 +1,4 @@ { "extends": "./tsconfig.json", - "compilerOptions": { - "sourceMap": true - }, "include": ["src/web", "src/common", "src/utils"] }