Skip to content

Commit

Permalink
fix(upload folder): improve node exports PE-4643
Browse files Browse the repository at this point in the history
  • Loading branch information
fedellen committed Aug 14, 2024
1 parent 07287d8 commit a6c073b
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/node/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import {
isEthPrivateKey,
isJWK,
} from '../types.js';
import { isWeb } from '../utils/common.js';
import { TurboWebArweaveSigner } from '../web/signer.js';
import { TurboNodeSigner } from './signer.js';
import { TurboAuthenticatedUploadService } from './upload.js';

Expand Down Expand Up @@ -69,12 +67,6 @@ export class TurboFactory extends TurboBaseFactory {
throw new Error('A privateKey or signer must be provided.');
}

if (isWeb()) {
return new TurboWebArweaveSigner({
signer,
logger: this.logger,
});
}
return new TurboNodeSigner({
signer,
logger: this.logger,
Expand Down Expand Up @@ -125,19 +117,13 @@ export class TurboFactory extends TurboBaseFactory {
token,
tokenTools,
});
const uploadService = isWeb()
? new TurboAuthenticatedUploadService({
...uploadServiceConfig,
signer: turboSigner,
logger: this.logger,
token,
})
: new TurboAuthenticatedUploadService({
...uploadServiceConfig,
signer: turboSigner,
logger: this.logger,
token,
});

const uploadService = new TurboAuthenticatedUploadService({
...uploadServiceConfig,
signer: turboSigner,
logger: this.logger,
token,
});
return new TurboAuthenticatedClient({
uploadService,
paymentService,
Expand Down

0 comments on commit a6c073b

Please sign in to comment.