@ardrive/turbo-sdk 1.23.3-alpha.test.0 → 1.23.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/web.bundle.min.js +37494 -21221
- package/lib/cjs/common/factory.js +3 -3
- package/lib/cjs/common/logger.js +73 -41
- package/lib/cjs/common/payment.js +3 -4
- package/lib/cjs/common/signer.js +4 -5
- package/lib/cjs/common/token/arweave.js +2 -3
- package/lib/cjs/common/token/ethereum.js +1 -1
- package/lib/cjs/common/token/kyve.js +1 -1
- package/lib/cjs/common/token/polygon.js +1 -1
- package/lib/cjs/common/token/solana.js +2 -3
- package/lib/cjs/common/upload.js +4 -5
- package/lib/cjs/node/signer.js +4 -5
- package/lib/cjs/node/upload.js +2 -2
- package/lib/cjs/utils/axiosClient.js +2 -2
- package/lib/cjs/utils/base64.js +1 -2
- package/lib/cjs/utils/readableStream.js +1 -17
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/signer.js +2 -3
- package/lib/esm/common/factory.js +4 -4
- package/lib/esm/common/logger.js +71 -39
- package/lib/esm/common/payment.js +3 -4
- package/lib/esm/common/signer.js +2 -3
- package/lib/esm/common/token/arweave.js +2 -3
- package/lib/esm/common/token/ethereum.js +2 -2
- package/lib/esm/common/token/kyve.js +2 -2
- package/lib/esm/common/token/polygon.js +2 -2
- package/lib/esm/common/token/solana.js +2 -3
- package/lib/esm/common/upload.js +2 -3
- package/lib/esm/node/signer.js +1 -2
- package/lib/esm/node/upload.js +1 -1
- package/lib/esm/utils/axiosClient.js +3 -3
- package/lib/esm/utils/base64.js +0 -1
- package/lib/esm/utils/readableStream.js +0 -16
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/signer.js +0 -1
- package/lib/types/common/factory.d.ts +5 -5
- package/lib/types/common/factory.d.ts.map +1 -1
- package/lib/types/common/http.d.ts +0 -1
- package/lib/types/common/http.d.ts.map +1 -1
- package/lib/types/common/logger.d.ts +8 -12
- package/lib/types/common/logger.d.ts.map +1 -1
- package/lib/types/common/payment.d.ts.map +1 -1
- package/lib/types/common/signer.d.ts +0 -1
- package/lib/types/common/signer.d.ts.map +1 -1
- package/lib/types/common/token/arweave.d.ts.map +1 -1
- package/lib/types/common/token/solana.d.ts.map +1 -1
- package/lib/types/common/upload.d.ts +1 -2
- package/lib/types/common/upload.d.ts.map +1 -1
- package/lib/types/node/signer.d.ts +1 -1
- package/lib/types/node/signer.d.ts.map +1 -1
- package/lib/types/node/upload.d.ts +1 -2
- package/lib/types/node/upload.d.ts.map +1 -1
- package/lib/types/types.d.ts +6 -6
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/utils/base64.d.ts +0 -1
- package/lib/types/utils/base64.d.ts.map +1 -1
- package/lib/types/utils/readableStream.d.ts +1 -2
- package/lib/types/utils/readableStream.d.ts.map +1 -1
- package/lib/types/web/signer.d.ts +0 -1
- package/lib/types/web/signer.d.ts.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/common/signing/signing.js +0 -205
- package/lib/esm/common/signing/signing.js +0 -205
- package/lib/types/common/signing/signing.d.ts +0 -16
- package/lib/types/common/signing/signing.d.ts.map +0 -1
package/lib/esm/common/logger.js
CHANGED
@@ -1,56 +1,88 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { createLogger, format, transports, } from 'winston';
|
1
17
|
import { version } from '../version.js';
|
2
|
-
export class
|
18
|
+
export class TurboWinstonLogger {
|
3
19
|
constructor({ level = 'info', logFormat = 'simple', } = {}) {
|
4
|
-
this.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
this.silent = false;
|
21
|
+
if (level === 'none') {
|
22
|
+
this.silent = true;
|
23
|
+
}
|
24
|
+
if (typeof window !== 'undefined') {
|
25
|
+
this.logger = console;
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
this.logger = createLogger({
|
29
|
+
level,
|
30
|
+
silent: this.silent,
|
31
|
+
defaultMeta: {
|
32
|
+
name: 'turbo-sdk',
|
33
|
+
version,
|
34
|
+
},
|
35
|
+
format: format.combine(format.timestamp(), format.json()),
|
36
|
+
transports: [
|
37
|
+
new transports.Console({
|
38
|
+
format: getLogFormat(logFormat),
|
39
|
+
}),
|
40
|
+
],
|
41
|
+
});
|
42
|
+
}
|
27
43
|
}
|
28
44
|
info(message, ...args) {
|
29
|
-
if (this.
|
30
|
-
|
31
|
-
|
45
|
+
if (this.silent)
|
46
|
+
return;
|
47
|
+
this.logger.info(message, ...args);
|
32
48
|
}
|
33
49
|
warn(message, ...args) {
|
34
|
-
if (this.
|
35
|
-
|
36
|
-
|
50
|
+
if (this.silent)
|
51
|
+
return;
|
52
|
+
this.logger.warn(message, ...args);
|
37
53
|
}
|
38
54
|
error(message, ...args) {
|
39
|
-
if (this.
|
40
|
-
|
41
|
-
|
55
|
+
if (this.silent)
|
56
|
+
return;
|
57
|
+
this.logger.error(message, ...args);
|
42
58
|
}
|
43
59
|
debug(message, ...args) {
|
44
|
-
if (this.
|
45
|
-
|
46
|
-
|
60
|
+
if (this.silent)
|
61
|
+
return;
|
62
|
+
this.logger.debug(message, ...args);
|
47
63
|
}
|
48
64
|
setLogLevel(level) {
|
49
|
-
this.level = level;
|
50
65
|
this.silent = level === 'none';
|
66
|
+
if ('silent' in this.logger) {
|
67
|
+
this.logger.silent = level === 'none';
|
68
|
+
}
|
69
|
+
if ('level' in this.logger) {
|
70
|
+
this.logger.level = level;
|
71
|
+
}
|
51
72
|
}
|
52
73
|
setLogFormat(logFormat) {
|
53
|
-
this.
|
74
|
+
if ('format' in this.logger) {
|
75
|
+
this.logger.format = getLogFormat(logFormat);
|
76
|
+
}
|
54
77
|
}
|
55
78
|
}
|
56
|
-
|
79
|
+
TurboWinstonLogger.default = new TurboWinstonLogger();
|
80
|
+
function getLogFormat(logFormat) {
|
81
|
+
return format.combine(format((info) => {
|
82
|
+
if (info.stack && info.level !== 'error') {
|
83
|
+
delete info.stack;
|
84
|
+
}
|
85
|
+
return info;
|
86
|
+
})(), format.errors({ stack: true }), // Ensure errors show a stack trace
|
87
|
+
format.timestamp(), logFormat === 'json' ? format.json() : format.simple());
|
88
|
+
}
|
@@ -14,14 +14,13 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { BigNumber } from 'bignumber.js';
|
17
|
-
import { Buffer } from 'node:buffer';
|
18
17
|
import { TurboHTTPService } from './http.js';
|
19
|
-
import {
|
18
|
+
import { TurboWinstonLogger } from './logger.js';
|
20
19
|
import { exponentMap, tokenToBaseMap } from './token/index.js';
|
21
20
|
export const developmentPaymentServiceURL = 'https://payment.ardrive.dev';
|
22
21
|
export const defaultPaymentServiceURL = 'https://payment.ardrive.io';
|
23
22
|
export class TurboUnauthenticatedPaymentService {
|
24
|
-
constructor({ url = defaultPaymentServiceURL, retryConfig, logger =
|
23
|
+
constructor({ url = defaultPaymentServiceURL, retryConfig, logger = TurboWinstonLogger.default, token = 'arweave', }) {
|
25
24
|
this.logger = logger;
|
26
25
|
this.httpService = new TurboHTTPService({
|
27
26
|
url: `${url}/v1`,
|
@@ -193,7 +192,7 @@ export class TurboUnauthenticatedPaymentService {
|
|
193
192
|
}
|
194
193
|
// NOTE: to avoid redundancy, we use inheritance here - but generally prefer composition over inheritance
|
195
194
|
export class TurboAuthenticatedPaymentService extends TurboUnauthenticatedPaymentService {
|
196
|
-
constructor({ url = defaultPaymentServiceURL, retryConfig, signer, logger =
|
195
|
+
constructor({ url = defaultPaymentServiceURL, retryConfig, signer, logger = TurboWinstonLogger.default, token = 'arweave', tokenTools, }) {
|
197
196
|
super({ url, retryConfig, logger, token });
|
198
197
|
this.signer = signer;
|
199
198
|
this.tokenTools = tokenTools;
|
package/lib/esm/common/signer.js
CHANGED
@@ -23,16 +23,15 @@ import bs58 from 'bs58';
|
|
23
23
|
import { randomBytes } from 'crypto';
|
24
24
|
import { Wallet as EthereumWallet, ethers, parseEther } from 'ethers';
|
25
25
|
import { computeAddress } from 'ethers';
|
26
|
-
import { Buffer } from 'node:buffer';
|
27
26
|
import nacl from 'tweetnacl';
|
28
27
|
import { isEthereumWalletAdapter, } from '../types.js';
|
29
28
|
import { fromB64Url, ownerToAddress as ownerToB64Address, toB64Url, } from '../utils/base64.js';
|
30
|
-
import {
|
29
|
+
import { TurboWinstonLogger } from './logger.js';
|
31
30
|
/**
|
32
31
|
* Abstract class for signing TurboDataItems.
|
33
32
|
*/
|
34
33
|
export class TurboDataItemAbstractSigner {
|
35
|
-
constructor({ signer, logger =
|
34
|
+
constructor({ signer, logger = TurboWinstonLogger.default, token, walletAdapter, }) {
|
36
35
|
this.logger = logger;
|
37
36
|
this.signer = signer;
|
38
37
|
this.token = token;
|
@@ -15,16 +15,15 @@
|
|
15
15
|
*/
|
16
16
|
import ArweaveModule from 'arweave';
|
17
17
|
import { BigNumber } from 'bignumber.js';
|
18
|
-
import { Buffer } from 'node:buffer';
|
19
18
|
import { sha256B64Url, toB64Url } from '../../utils/base64.js';
|
20
19
|
import { sleep } from '../../utils/common.js';
|
21
|
-
import {
|
20
|
+
import { TurboWinstonLogger } from '../logger.js';
|
22
21
|
const ArweaveClass =
|
23
22
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
24
23
|
// @ts-ignore -- Access the correct class constructor for Arweave
|
25
24
|
ArweaveModule.default?.default || ArweaveModule.default || ArweaveModule;
|
26
25
|
export class ArweaveToken {
|
27
|
-
constructor({ gatewayUrl = 'https://arweave.net', arweave, logger =
|
26
|
+
constructor({ gatewayUrl = 'https://arweave.net', arweave, logger = TurboWinstonLogger.default, mintU = true, pollingOptions = {
|
28
27
|
maxAttempts: 10,
|
29
28
|
pollingIntervalMs: 3_000,
|
30
29
|
initialBackoffMs: 7_000,
|
@@ -16,11 +16,11 @@
|
|
16
16
|
import { BigNumber } from 'bignumber.js';
|
17
17
|
import { ethers } from 'ethers';
|
18
18
|
import { defaultProdGatewayUrls } from '../../cli/constants.js';
|
19
|
-
import {
|
19
|
+
import { TurboWinstonLogger } from '../logger.js';
|
20
20
|
export const weiToTokenAmount = (wei) => wei;
|
21
21
|
export const ETHToTokenAmount = (eth) => new BigNumber(eth).times(1e18).valueOf();
|
22
22
|
export class EthereumToken {
|
23
|
-
constructor({ logger =
|
23
|
+
constructor({ logger = TurboWinstonLogger.default, gatewayUrl = defaultProdGatewayUrls.ethereum, pollingOptions = {
|
24
24
|
maxAttempts: 10,
|
25
25
|
pollingIntervalMs: 4_000,
|
26
26
|
initialBackoffMs: 10_000,
|
@@ -21,14 +21,14 @@ import { BigNumber } from 'bignumber.js';
|
|
21
21
|
import { defaultProdGatewayUrls } from '../../cli/constants.js';
|
22
22
|
import { createAxiosInstance } from '../../utils/axiosClient.js';
|
23
23
|
import { sleep } from '../../utils/common.js';
|
24
|
-
import {
|
24
|
+
import { TurboWinstonLogger } from '../logger.js';
|
25
25
|
function hasKyveTxResponse(response) {
|
26
26
|
return response.tx_response !== undefined;
|
27
27
|
}
|
28
28
|
export const ukyveToTokenAmount = (winston) => winston;
|
29
29
|
export const KYVEToTokenAmount = (sol) => new BigNumber(sol).times(1e6).valueOf();
|
30
30
|
export class KyveToken {
|
31
|
-
constructor({ logger =
|
31
|
+
constructor({ logger = TurboWinstonLogger.default, gatewayUrl = defaultProdGatewayUrls.kyve, pollingOptions = {
|
32
32
|
maxAttempts: 5,
|
33
33
|
pollingIntervalMs: 1_000,
|
34
34
|
initialBackoffMs: 500,
|
@@ -14,11 +14,11 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { defaultProdGatewayUrls } from '../../cli/constants.js';
|
17
|
-
import {
|
17
|
+
import { TurboWinstonLogger } from '../logger.js';
|
18
18
|
import { ETHToTokenAmount, EthereumToken } from './ethereum.js';
|
19
19
|
export const POLToTokenAmount = ETHToTokenAmount;
|
20
20
|
export class PolygonToken extends EthereumToken {
|
21
|
-
constructor({ logger =
|
21
|
+
constructor({ logger = TurboWinstonLogger.default, gatewayUrl = defaultProdGatewayUrls.pol, pollingOptions = {
|
22
22
|
maxAttempts: 10,
|
23
23
|
pollingIntervalMs: 4_000,
|
24
24
|
initialBackoffMs: 5_000,
|
@@ -16,14 +16,13 @@
|
|
16
16
|
import { Connection, PublicKey, SystemProgram, Transaction, } from '@solana/web3.js';
|
17
17
|
import { BigNumber } from 'bignumber.js';
|
18
18
|
import bs58 from 'bs58';
|
19
|
-
import { Buffer } from 'node:buffer';
|
20
19
|
import { defaultProdGatewayUrls } from '../../cli/constants.js';
|
21
20
|
import { sleep } from '../../utils/common.js';
|
22
|
-
import {
|
21
|
+
import { TurboWinstonLogger } from '../logger.js';
|
23
22
|
export const lamportToTokenAmount = (winston) => winston;
|
24
23
|
export const SOLToTokenAmount = (sol) => new BigNumber(sol).times(1e9).valueOf();
|
25
24
|
export class SolanaToken {
|
26
|
-
constructor({ logger =
|
25
|
+
constructor({ logger = TurboWinstonLogger.default, gatewayUrl = defaultProdGatewayUrls.solana, pollingOptions = {
|
27
26
|
maxAttempts: 10,
|
28
27
|
pollingIntervalMs: 2_500,
|
29
28
|
initialBackoffMs: 500,
|
package/lib/esm/common/upload.js
CHANGED
@@ -14,13 +14,12 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { AxiosError, CanceledError } from 'axios';
|
17
|
-
import { Buffer } from 'node:buffer';
|
18
17
|
import { pLimit } from 'plimit-lit';
|
19
18
|
import { defaultRetryConfig } from '../utils/axiosClient.js';
|
20
19
|
import { sleep } from '../utils/common.js';
|
21
20
|
import { FailedRequestError } from '../utils/errors.js';
|
22
21
|
import { TurboHTTPService } from './http.js';
|
23
|
-
import {
|
22
|
+
import { TurboWinstonLogger } from './logger.js';
|
24
23
|
export const creditSharingTagNames = {
|
25
24
|
shareCredits: 'x-approve-payment',
|
26
25
|
sharedWincAmount: 'x-amount',
|
@@ -30,7 +29,7 @@ export const creditSharingTagNames = {
|
|
30
29
|
export const developmentUploadServiceURL = 'https://upload.ardrive.dev';
|
31
30
|
export const defaultUploadServiceURL = 'https://upload.ardrive.io';
|
32
31
|
export class TurboUnauthenticatedUploadService {
|
33
|
-
constructor({ url = defaultUploadServiceURL, logger =
|
32
|
+
constructor({ url = defaultUploadServiceURL, logger = TurboWinstonLogger.default, retryConfig = defaultRetryConfig(logger), token = 'arweave', }) {
|
34
33
|
this.token = token;
|
35
34
|
this.logger = logger;
|
36
35
|
this.httpService = new TurboHTTPService({
|
package/lib/esm/node/signer.js
CHANGED
@@ -14,8 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { ArconnectSigner, ArweaveSigner, EthereumSigner, HexSolanaSigner, serializeTags, streamSigner, } from '@dha-team/arbundles';
|
17
|
-
import {
|
18
|
-
import { Readable } from 'node:stream';
|
17
|
+
import { Readable } from 'stream';
|
19
18
|
import { TurboDataItemAbstractSigner } from '../common/signer.js';
|
20
19
|
import { fromB64Url } from '../utils/base64.js';
|
21
20
|
/**
|
package/lib/esm/node/upload.js
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
*/
|
16
16
|
import { createReadStream, promises, statSync } from 'fs';
|
17
17
|
import { lookup } from 'mime-types';
|
18
|
-
import { Readable } from 'node:stream';
|
19
18
|
import { join } from 'path';
|
19
|
+
import { Readable } from 'stream';
|
20
20
|
import { TurboAuthenticatedBaseUploadService, defaultUploadServiceURL, } from '../common/upload.js';
|
21
21
|
import { isNodeUploadFolderParams, } from '../types.js';
|
22
22
|
export class TurboAuthenticatedUploadService extends TurboAuthenticatedBaseUploadService {
|
@@ -15,13 +15,13 @@
|
|
15
15
|
*/
|
16
16
|
import axios, { CanceledError } from 'axios';
|
17
17
|
import axiosRetry from 'axios-retry';
|
18
|
-
import {
|
18
|
+
import { TurboWinstonLogger } from '../common/logger.js';
|
19
19
|
import { version } from '../version.js';
|
20
20
|
export const defaultRequestHeaders = {
|
21
21
|
'x-turbo-source-version': version,
|
22
22
|
'x-turbo-source-identifier': 'turbo-sdk',
|
23
23
|
};
|
24
|
-
export const defaultRetryConfig = (logger =
|
24
|
+
export const defaultRetryConfig = (logger = TurboWinstonLogger.default) => ({
|
25
25
|
retryDelay: axiosRetry.exponentialDelay,
|
26
26
|
retries: 5,
|
27
27
|
retryCondition: (error) => {
|
@@ -33,7 +33,7 @@ export const defaultRetryConfig = (logger = ConsoleTurboLogger.default) => ({
|
|
33
33
|
logger.debug(`Request failed, ${error}. Retry attempt #${retryCount}...`);
|
34
34
|
},
|
35
35
|
});
|
36
|
-
export const createAxiosInstance = ({ logger =
|
36
|
+
export const createAxiosInstance = ({ logger = TurboWinstonLogger.default, axiosConfig = {}, retryConfig = defaultRetryConfig(logger), } = {}) => {
|
37
37
|
const axiosInstance = axios.create({
|
38
38
|
...axiosConfig,
|
39
39
|
headers: {
|
package/lib/esm/utils/base64.js
CHANGED
@@ -15,7 +15,6 @@
|
|
15
15
|
*/
|
16
16
|
import { bufferTob64Url } from 'arweave/node/lib/utils.js';
|
17
17
|
import { createHash } from 'crypto';
|
18
|
-
import { Buffer } from 'node:buffer';
|
19
18
|
export const base64URLRegex = /^[a-zA-Z0-9_-]{43}$/;
|
20
19
|
export function jwkToPublicArweaveAddress(jwk) {
|
21
20
|
return ownerToAddress(jwk.n);
|
@@ -1,19 +1,3 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
import { Buffer } from 'node:buffer';
|
17
1
|
export async function readableStreamToBuffer({ stream, size, }) {
|
18
2
|
const reader = stream.getReader();
|
19
3
|
const buffer = Buffer.alloc(size);
|
package/lib/esm/version.js
CHANGED
package/lib/esm/web/signer.js
CHANGED
@@ -14,7 +14,6 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { ArconnectSigner, ArweaveSigner, DataItem, EthereumSigner, HexSolanaSigner, InjectedEthereumSigner, createData, } from '@dha-team/arbundles';
|
17
|
-
import { Buffer } from 'node:buffer';
|
18
17
|
import { TurboDataItemAbstractSigner } from '../common/signer.js';
|
19
18
|
import { readableStreamToBuffer } from '../utils/readableStream.js';
|
20
19
|
/**
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { GetTurboSignerParams, TurboAuthenticatedConfiguration, TurboAuthenticatedUploadServiceConfiguration, TurboAuthenticatedUploadServiceInterface, TurboUnauthenticatedConfiguration } from '../types.js';
|
2
|
-
import {
|
2
|
+
import { TurboWinstonLogger } from './logger.js';
|
3
3
|
import { TurboDataItemAbstractSigner } from './signer.js';
|
4
4
|
import { TurboAuthenticatedClient, TurboUnauthenticatedClient } from './turbo.js';
|
5
5
|
export declare abstract class TurboBaseFactory {
|
6
|
-
protected static logger:
|
7
|
-
static setLogLevel(level:
|
8
|
-
static setLogFormat(format:
|
6
|
+
protected static logger: TurboWinstonLogger;
|
7
|
+
static setLogLevel(level: string): void;
|
8
|
+
static setLogFormat(format: string): void;
|
9
9
|
static unauthenticated({ paymentServiceConfig, uploadServiceConfig, token, }?: TurboUnauthenticatedConfiguration): TurboUnauthenticatedClient;
|
10
10
|
protected abstract getSigner({ providedPrivateKey, providedSigner, providedWalletAdapter, logger, token, }: GetTurboSignerParams): TurboDataItemAbstractSigner;
|
11
11
|
protected abstract getAuthenticatedUploadService(config: TurboAuthenticatedUploadServiceConfiguration): TurboAuthenticatedUploadServiceInterface;
|
12
12
|
protected getAuthenticatedTurbo({ privateKey, signer: providedSigner, paymentServiceConfig, uploadServiceConfig, token, gatewayUrl, tokenMap, tokenTools, logger, walletAdapter, }: TurboAuthenticatedConfiguration & {
|
13
|
-
logger:
|
13
|
+
logger: TurboWinstonLogger;
|
14
14
|
}): TurboAuthenticatedClient;
|
15
15
|
private signerFromAdapter;
|
16
16
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/common/factory.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,oBAAoB,EAEpB,+BAA+B,EAC/B,4CAA4C,EAC5C,wCAAwC,EACxC,iCAAiC,EAIlC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/common/factory.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,oBAAoB,EAEpB,+BAA+B,EAC/B,4CAA4C,EAC5C,wCAAwC,EACxC,iCAAiC,EAIlC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAGpB,8BAAsB,gBAAgB;IACpC,SAAS,CAAC,MAAM,CAAC,MAAM,qBAA8B;IAGrD,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;IAKhC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM;IAIlC,MAAM,CAAC,eAAe,CAAC,EACrB,oBAAyB,EACzB,mBAAwB,EACxB,KAAK,GACN,GAAE,iCAAsC;IAqBzC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC3B,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,MAAM,EACN,KAAK,GACN,EAAE,oBAAoB,GAAG,2BAA2B;IAErD,SAAS,CAAC,QAAQ,CAAC,6BAA6B,CAC9C,MAAM,EAAE,4CAA4C,GACnD,wCAAwC;IAE3C,SAAS,CAAC,qBAAqB,CAAC,EAC9B,UAAU,EACV,MAAM,EAAE,cAAc,EACtB,oBAAyB,EACzB,mBAAwB,EACxB,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,GACd,EAAE,+BAA+B,GAAG;QAAE,MAAM,EAAE,kBAAkB,CAAA;KAAE;IA6DnE,OAAO,CAAC,iBAAiB;CAuB1B"}
|
@@ -15,7 +15,6 @@
|
|
15
15
|
*/
|
16
16
|
import { AxiosInstance } from 'axios';
|
17
17
|
import { IAxiosRetryConfig } from 'axios-retry';
|
18
|
-
import { Buffer } from 'node:buffer';
|
19
18
|
import { Readable } from 'stream';
|
20
19
|
import { ReadableStream } from 'stream/web';
|
21
20
|
import { TurboHTTPServiceInterface, TurboLogger, TurboSignedRequestHeaders } from '../types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/common/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAc,aAAa,EAA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E,WAAW,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;KAC1C,GAAG,OAAO,CAAC,CAAC,CAAC;YAOA,UAAU;CAwBzB"}
|
@@ -13,25 +13,21 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
+
import { Logger as WinstonLogger } from 'winston';
|
16
17
|
import { TurboLogger } from '../types.js';
|
17
|
-
export
|
18
|
-
|
19
|
-
export declare class ConsoleTurboLogger implements TurboLogger {
|
20
|
-
private level;
|
21
|
-
private format;
|
18
|
+
export declare class TurboWinstonLogger implements TurboLogger {
|
19
|
+
protected logger: WinstonLogger | Console;
|
22
20
|
private silent;
|
23
|
-
static default:
|
21
|
+
static default: TurboWinstonLogger;
|
24
22
|
constructor({ level, logFormat, }?: {
|
25
|
-
level?:
|
26
|
-
logFormat?:
|
23
|
+
level?: 'info' | 'debug' | 'error' | 'none' | undefined;
|
24
|
+
logFormat?: 'simple' | 'json' | undefined;
|
27
25
|
});
|
28
|
-
private shouldLog;
|
29
|
-
private formatMessage;
|
30
26
|
info(message: string, ...args: unknown[]): void;
|
31
27
|
warn(message: string, ...args: unknown[]): void;
|
32
28
|
error(message: string, ...args: unknown[]): void;
|
33
29
|
debug(message: string, ...args: unknown[]): void;
|
34
|
-
setLogLevel(level:
|
35
|
-
setLogFormat(logFormat:
|
30
|
+
setLogLevel(level: string): void;
|
31
|
+
setLogFormat(logFormat: string): void;
|
36
32
|
}
|
37
33
|
//# sourceMappingURL=logger.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,MAAM,IAAI,aAAa,EAIxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,qBAAa,kBAAmB,YAAW,WAAW;IACpD,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC;IAC1C,OAAO,CAAC,MAAM,CAAS;IAEvB,MAAM,CAAC,OAAO,qBAA4B;gBAE9B,EACV,KAAc,EACd,SAAoB,GACrB,GAAE;QACD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;KACtC;IAwBN,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAMxC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAMxC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAMzC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAMzC,WAAW,CAAC,KAAK,EAAE,MAAM;IAWzB,YAAY,CAAC,SAAS,EAAE,MAAM;CAK/B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/common/payment.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/common/payment.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,QAAQ,EACR,+BAA+B,EAE/B,UAAU,EACV,SAAS,EAET,6CAA6C,EAC7C,yCAAyC,EACzC,o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AAuB,CAAC,EACnC,WAAW,GACZ,EAAE;QACD,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAK/B,cAAc,CAAC,EAC1B,MAAM,EACN,UAAe,GAChB,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAQhD,qBAAqB,CAChC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,4BAA4B,CAAC;YAI1B,sBAAsB;IAYvB,eAAe,CAAC,EAC3B,aAAiB,EACjB,WAAW,EAAE,YAAY,GAC1B,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CA+ChE"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { Buffer } from 'node:buffer';
|
2
1
|
import { FileStreamFactory, NativeAddress, SendTxWithSignerParams, TokenType, TurboDataItemSigner, TurboDataItemSignerParams, TurboFileFactory, TurboLogger, TurboSignedDataItemFactory, TurboSigner, WalletAdapter } from '../types.js';
|
3
2
|
/**
|
4
3
|
* Abstract class for signing TurboDataItems.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/common/signer.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/common/signer.ts"],"names":[],"mappings":"AA2BA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,SAAS,EACT,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,aAAa,EAEd,MAAM,aAAa,CAAC;AAQrB;;GAEG;AACH,8BAAsB,2BACpB,YAAW,mBAAmB;IAE9B,QAAQ,CAAC,YAAY,CAAC,EACpB,iBAAiB,EACjB,eAAe,EACf,YAAY,GACb,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAE5E,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;gBAEvC,EACV,MAAM,EACN,MAAmC,EACnC,KAAK,EACL,aAAa,GACd,EAAE,yBAAyB;IAO5B,OAAO,CAAC,oBAAoB;IA2Bf,4BAA4B;;;;;IAY5B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/B,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAOvD,gGAAgG;IACnF,eAAe,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,UAAU,GACX,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAkE9B,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAgBnE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"arweave.d.ts","sourceRoot":"","sources":["../../../../src/common/token/arweave.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,aAAa,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"arweave.d.ts","sourceRoot":"","sources":["../../../../src/common/token/arweave.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,aAAa,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAUxB,qBAAa,YAAa,YAAW,UAAU;IAC7C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;gBAElC,EACV,UAAkC,EAClC,OAAO,EACP,MAAmC,EACnC,KAAY,EACZ,cAIC,GACF,GAAE;QACD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,cAAc,CAAC,EAAE,mBAAmB,CAAC;KACjC;IAeO,iBAAiB,CAAC,EAC7B,aAAa,EACb,MAAM,EACN,WAAW,EACX,MAAM,GACP,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IA4CW,uBAAuB,CAAC,EACnC,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;IAqDJ,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB9C;AAED,eAAO,MAAM,oBAAoB,YAAa,SAAS,CAAC,KAAK,oBAAY,CAAC;AAC1E,eAAO,MAAM,eAAe,OAAQ,SAAS,CAAC,KAAK,WACV,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/common/token/solana.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,UAAU,EAMX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/common/token/solana.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,UAAU,EAMX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,oBAAoB,YAAa,SAAS,CAAC,KAAK,oBAAY,CAAC;AAC1E,eAAO,MAAM,gBAAgB,QAAS,SAAS,CAAC,KAAK,WACZ,CAAC;AAE1C,qBAAa,WAAY,YAAW,UAAU;IAC5C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;gBAElC,EACV,MAAmC,EACnC,UAA0C,EAC1C,cAIC,GACF,GAAE,WAAgB;IAQN,iBAAiB,CAAC,EAC7B,MAAM,EACN,WAAW,EACX,MAAM,GACP,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;YA4BY,QAAQ;IA2BT,uBAAuB,CAAC,EACnC,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;CA4ClB"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { IAxiosRetryConfig } from 'axios-retry';
|
2
|
-
import {
|
3
|
-
import { Readable } from 'node:stream';
|
2
|
+
import { Readable } from 'stream';
|
4
3
|
import { ArweaveManifest, CreditShareApproval, TokenType, TurboAbortSignal, TurboAuthenticatedUploadServiceConfiguration, TurboAuthenticatedUploadServiceInterface, TurboCreateCreditShareApprovalParams, TurboDataItemSigner, TurboFileFactory, TurboLogger, TurboRevokeCreditsParams, TurboSignedDataItemFactory, TurboUnauthenticatedUploadServiceConfiguration, TurboUnauthenticatedUploadServiceInterface, TurboUploadDataItemResponse, TurboUploadFolderParams, TurboUploadFolderResponse } from '../types.js';
|
5
4
|
import { TurboHTTPService } from './http.js';
|
6
5
|
export declare const creditSharingTagNames: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/common/upload.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/common/upload.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EACL,eAAe,EACf,mBAAmB,EAEnB,SAAS,EACT,gBAAgB,EAChB,4CAA4C,EAC5C,wCAAwC,EACxC,oCAAoC,EACpC,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,0BAA0B,EAC1B,8CAA8C,EAC9C,0CAA0C,EAC1C,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC;AAEF,eAAO,MAAM,2BAA2B,+BAA+B,CAAC;AACxE,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,qBAAa,iCACX,YAAW,0CAA0C;IAErD,SAAS,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACxC,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,WAAW,EAAE,iBAAiB,CAAC;gBAE7B,EACV,GAA6B,EAC7B,MAAmC,EACnC,WAAwC,EACxC,KAAiB,GAClB,EAAE,8CAA8C;IAW3C,oBAAoB,CAAC,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,GACP,EAAE,0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BAAuB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAqGxB,YAAY,CAAC,EACxB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,GACjB,EAAE,oCAAoC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAqCzD,aAAa,CAAC,EACzB,cAAc,GACf,EAAE,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAwB7D"}
|
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { ArconnectSigner, ArweaveSigner, EthereumSigner, HexSolanaSigner } from '@dha-team/arbundles';
|
17
|
-
import { Readable } from '
|
17
|
+
import { Readable } from 'stream';
|
18
18
|
import { TurboDataItemAbstractSigner } from '../common/signer.js';
|
19
19
|
import { NodeFileStreamFactory, StreamSizeFactory, TurboDataItemSignerParams, TurboFileFactory } from '../types.js';
|
20
20
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/node/signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EAGhB,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/node/signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EAGhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAEL,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAE3E;;GAEG;AACH,qBAAa,eAAgB,SAAQ,2BAA2B;gBAClD,CAAC,EAAE,yBAAyB;IAIlC,YAAY,CAAC,EACjB,iBAAiB,EACjB,eAAe,EACf,YAAY,GACb,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QACnD,qBAAqB,EAAE,MAAM,QAAQ,CAAC;QACtC,mBAAmB,EAAE,iBAAiB,CAAC;KACxC,CAAC;IA6BF,OAAO,CAAC,8BAA8B;CAkCvC"}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { Readable } from 'node:stream';
|
1
|
+
import { Readable } from 'stream';
|
3
2
|
import { TurboAuthenticatedBaseUploadService } from '../common/upload.js';
|
4
3
|
import { TurboAuthenticatedUploadServiceConfiguration, TurboUploadFolderParams } from '../types.js';
|
5
4
|
export declare class TurboAuthenticatedUploadService extends TurboAuthenticatedBaseUploadService {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/node/upload.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/node/upload.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EACL,mCAAmC,EAEpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,4CAA4C,EAC5C,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAErB,qBAAa,+BAAgC,SAAQ,mCAAmC;gBAC1E,EACV,GAA6B,EAC7B,WAAW,EACX,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE,4CAA4C;YAIjC,8BAA8B;IAyB5C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO5D,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAI5C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,MAAM;IAYtE,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKzC,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ;CAGvD"}
|
package/lib/types/types.d.ts
CHANGED
@@ -17,11 +17,11 @@ import { ArconnectSigner, ArweaveSigner, DataItemCreateOptions, EthereumSigner,
|
|
17
17
|
import { IAxiosRetryConfig } from 'axios-retry';
|
18
18
|
import { BigNumber } from 'bignumber.js';
|
19
19
|
import { JsonRpcSigner } from 'ethers';
|
20
|
-
import { Readable } from '
|
21
|
-
import { ReadableStream } from '
|
20
|
+
import { Readable } from 'stream';
|
21
|
+
import { ReadableStream } from 'stream/web';
|
22
22
|
import { CurrencyMap } from './common/currency.js';
|
23
23
|
import { JWKInterface } from './common/jwk.js';
|
24
|
-
import {
|
24
|
+
import { TurboWinstonLogger } from './common/logger.js';
|
25
25
|
export type Base64String = string;
|
26
26
|
export type NativeAddress = string;
|
27
27
|
export type PublicArweaveAddress = Base64String;
|
@@ -290,8 +290,8 @@ export type TurboUnauthenticatedConfiguration = {
|
|
290
290
|
gatewayUrl?: string;
|
291
291
|
};
|
292
292
|
export interface TurboLogger {
|
293
|
-
setLogLevel: (level:
|
294
|
-
setLogFormat: (logFormat:
|
293
|
+
setLogLevel: (level: string) => void;
|
294
|
+
setLogFormat: (logFormat: string) => void;
|
295
295
|
info: (message: string, ...args: unknown[]) => void;
|
296
296
|
warn: (message: string, ...args: unknown[]) => void;
|
297
297
|
error: (message: string, ...args: unknown[]) => void;
|
@@ -331,7 +331,7 @@ export type GetTurboSignerParams = {
|
|
331
331
|
providedPrivateKey: TurboWallet | undefined;
|
332
332
|
providedWalletAdapter: WalletAdapter | undefined;
|
333
333
|
token: TokenType;
|
334
|
-
logger:
|
334
|
+
logger: TurboWinstonLogger;
|
335
335
|
};
|
336
336
|
export declare function isEthereumWalletAdapter(walletAdapter: SolanaWalletAdapter | EthereumWalletAdapter): walletAdapter is EthereumWalletAdapter;
|
337
337
|
export type TurboUnauthenticatedClientConfiguration = {
|