@ardrive/turbo-sdk 1.17.0 → 1.18.0-alpha.2
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/LICENSE.md +201 -661
- package/README.md +2 -0
- package/bundles/web.bundle.min.js +65 -64
- package/lib/cjs/cli/commands/balance.js +10 -11
- package/lib/cjs/cli/commands/cryptoFund.js +10 -11
- package/lib/cjs/cli/commands/index.js +10 -11
- package/lib/cjs/cli/commands/price.js +10 -11
- package/lib/cjs/cli/commands/topUp.js +10 -11
- package/lib/cjs/cli/commands/uploadFile.js +10 -11
- package/lib/cjs/cli/commands/uploadFolder.js +10 -11
- package/lib/cjs/cli/constants.js +10 -11
- package/lib/cjs/cli/errors.js +10 -11
- package/lib/cjs/cli/options.js +22 -11
- package/lib/cjs/cli/types.js +10 -11
- package/lib/cjs/cli/utils.js +34 -18
- package/lib/cjs/common/index.js +10 -11
- package/lib/cjs/common/logger.js +10 -11
- package/lib/cjs/common/payment.js +10 -11
- package/lib/cjs/common/signer.js +11 -12
- package/lib/cjs/common/token/arweave.js +10 -11
- package/lib/cjs/common/token/ethereum.js +10 -11
- package/lib/cjs/common/token/kyve.js +11 -12
- package/lib/cjs/common/token/solana.js +10 -11
- package/lib/cjs/common/upload.js +10 -11
- package/lib/cjs/node/factory.js +11 -12
- package/lib/cjs/node/index.js +10 -11
- package/lib/cjs/node/signer.js +15 -13
- package/lib/cjs/node/upload.js +10 -11
- package/lib/cjs/utils/axiosClient.js +10 -11
- package/lib/cjs/utils/base64.js +10 -11
- package/lib/cjs/utils/common.js +11 -12
- package/lib/cjs/utils/errors.js +10 -11
- package/lib/cjs/utils/readableStream.js +10 -11
- package/lib/cjs/version.js +11 -12
- package/lib/cjs/web/factory.js +11 -12
- package/lib/cjs/web/index.js +10 -11
- package/lib/cjs/web/signer.js +18 -16
- package/lib/cjs/web/upload.js +10 -11
- package/lib/esm/cli/commands/balance.js +10 -11
- package/lib/esm/cli/commands/cryptoFund.js +10 -11
- package/lib/esm/cli/commands/index.js +10 -11
- package/lib/esm/cli/commands/price.js +10 -11
- package/lib/esm/cli/commands/topUp.js +10 -11
- package/lib/esm/cli/commands/uploadFile.js +10 -11
- package/lib/esm/cli/commands/uploadFolder.js +10 -11
- package/lib/esm/cli/constants.js +10 -11
- package/lib/esm/cli/errors.js +10 -11
- package/lib/esm/cli/options.js +22 -11
- package/lib/esm/cli/types.js +10 -11
- package/lib/esm/cli/utils.js +34 -18
- package/lib/esm/common/index.js +10 -11
- package/lib/esm/common/logger.js +10 -11
- package/lib/esm/common/payment.js +10 -11
- package/lib/esm/common/signer.js +11 -12
- package/lib/esm/common/token/arweave.js +10 -11
- package/lib/esm/common/token/ethereum.js +10 -11
- package/lib/esm/common/token/kyve.js +11 -12
- package/lib/esm/common/token/solana.js +10 -11
- package/lib/esm/common/upload.js +10 -11
- package/lib/esm/node/factory.js +11 -12
- package/lib/esm/node/index.js +10 -11
- package/lib/esm/node/signer.js +15 -13
- package/lib/esm/node/upload.js +10 -11
- package/lib/esm/utils/axiosClient.js +10 -11
- package/lib/esm/utils/base64.js +10 -11
- package/lib/esm/utils/common.js +11 -12
- package/lib/esm/utils/errors.js +10 -11
- package/lib/esm/utils/readableStream.js +10 -11
- package/lib/esm/version.js +11 -12
- package/lib/esm/web/factory.js +11 -12
- package/lib/esm/web/index.js +10 -11
- package/lib/esm/web/signer.js +18 -16
- package/lib/esm/web/upload.js +10 -11
- package/lib/types/cli/commands/balance.d.ts.map +1 -1
- package/lib/types/cli/commands/cryptoFund.d.ts.map +1 -1
- package/lib/types/cli/commands/index.d.ts +10 -11
- package/lib/types/cli/commands/index.d.ts.map +1 -1
- package/lib/types/cli/commands/price.d.ts.map +1 -1
- package/lib/types/cli/commands/topUp.d.ts.map +1 -1
- package/lib/types/cli/commands/uploadFile.d.ts.map +1 -1
- package/lib/types/cli/commands/uploadFolder.d.ts.map +1 -1
- package/lib/types/cli/constants.d.ts.map +1 -1
- package/lib/types/cli/errors.d.ts +10 -11
- package/lib/types/cli/errors.d.ts.map +1 -1
- package/lib/types/cli/options.d.ts +28 -11
- package/lib/types/cli/options.d.ts.map +1 -1
- package/lib/types/cli/types.d.ts +12 -11
- package/lib/types/cli/types.d.ts.map +1 -1
- package/lib/types/cli/utils.d.ts.map +1 -1
- package/lib/types/common/currency.d.ts +10 -11
- package/lib/types/common/currency.d.ts.map +1 -1
- package/lib/types/common/factory.d.ts +10 -11
- package/lib/types/common/factory.d.ts.map +1 -1
- package/lib/types/common/http.d.ts +10 -11
- package/lib/types/common/http.d.ts.map +1 -1
- package/lib/types/common/index.d.ts +10 -11
- package/lib/types/common/index.d.ts.map +1 -1
- package/lib/types/common/jwk.d.ts +10 -11
- package/lib/types/common/jwk.d.ts.map +1 -1
- package/lib/types/common/logger.d.ts +10 -11
- 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.map +1 -1
- package/lib/types/common/token/arweave.d.ts +10 -11
- package/lib/types/common/token/arweave.d.ts.map +1 -1
- package/lib/types/common/token/ethereum.d.ts +10 -11
- package/lib/types/common/token/ethereum.d.ts.map +1 -1
- package/lib/types/common/token/index.d.ts +10 -11
- package/lib/types/common/token/index.d.ts.map +1 -1
- package/lib/types/common/token/kyve.d.ts.map +1 -1
- package/lib/types/common/token/polygon.d.ts +10 -11
- package/lib/types/common/token/polygon.d.ts.map +1 -1
- package/lib/types/common/token/solana.d.ts +10 -11
- package/lib/types/common/token/solana.d.ts.map +1 -1
- package/lib/types/common/turbo.d.ts +10 -11
- package/lib/types/common/turbo.d.ts.map +1 -1
- package/lib/types/common/upload.d.ts +10 -11
- package/lib/types/common/upload.d.ts.map +1 -1
- package/lib/types/node/factory.d.ts.map +1 -1
- package/lib/types/node/index.d.ts +10 -11
- package/lib/types/node/index.d.ts.map +1 -1
- package/lib/types/node/signer.d.ts +13 -18
- package/lib/types/node/signer.d.ts.map +1 -1
- package/lib/types/node/upload.d.ts.map +1 -1
- package/lib/types/types.d.ts +14 -14
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/utils/axiosClient.d.ts +10 -11
- package/lib/types/utils/axiosClient.d.ts.map +1 -1
- package/lib/types/utils/base64.d.ts.map +1 -1
- package/lib/types/utils/common.d.ts.map +1 -1
- package/lib/types/utils/errors.d.ts +10 -11
- package/lib/types/utils/errors.d.ts.map +1 -1
- package/lib/types/utils/readableStream.d.ts +10 -11
- package/lib/types/utils/readableStream.d.ts.map +1 -1
- package/lib/types/version.d.ts +11 -12
- package/lib/types/version.d.ts.map +1 -1
- package/lib/types/web/factory.d.ts.map +1 -1
- package/lib/types/web/index.d.ts +10 -11
- package/lib/types/web/index.d.ts.map +1 -1
- package/lib/types/web/signer.d.ts +11 -12
- package/lib/types/web/signer.d.ts.map +1 -1
- package/lib/types/web/upload.d.ts +10 -11
- package/lib/types/web/upload.d.ts.map +1 -1
- package/package.json +3 -3
package/lib/cjs/common/upload.js
CHANGED
@@ -2,20 +2,19 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboAuthenticatedBaseUploadService = exports.TurboUnauthenticatedUploadService = exports.defaultUploadServiceURL = exports.developmentUploadServiceURL = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
19
|
const node_buffer_1 = require("node:buffer");
|
21
20
|
const plimit_lit_1 = require("plimit-lit");
|
package/lib/cjs/node/factory.js
CHANGED
@@ -2,22 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboFactory = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
|
-
const arbundles_1 = require("@
|
19
|
+
const arbundles_1 = require("@dha-team/arbundles");
|
21
20
|
const factory_js_1 = require("../common/factory.js");
|
22
21
|
const index_js_1 = require("../common/index.js");
|
23
22
|
const payment_js_1 = require("../common/payment.js");
|
package/lib/cjs/node/index.js
CHANGED
@@ -15,20 +15,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
/**
|
18
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
18
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
19
19
|
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
* (at your option) any later version.
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
21
|
+
* you may not use this file except in compliance with the License.
|
22
|
+
* You may obtain a copy of the License at
|
24
23
|
*
|
25
|
-
*
|
26
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28
|
-
* GNU Affero General Public License for more details.
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
29
25
|
*
|
30
|
-
*
|
31
|
-
*
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
29
|
+
* See the License for the specific language governing permissions and
|
30
|
+
* limitations under the License.
|
32
31
|
*/
|
33
32
|
__exportStar(require("./factory.js"), exports);
|
34
33
|
__exportStar(require("./signer.js"), exports);
|
package/lib/cjs/node/signer.js
CHANGED
@@ -2,27 +2,27 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboNodeSigner = exports.HexSolanaSigner = exports.EthereumSigner = exports.ArweaveSigner = exports.ArconnectSigner = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
|
-
const arbundles_1 = require("@
|
19
|
+
const arbundles_1 = require("@dha-team/arbundles");
|
21
20
|
Object.defineProperty(exports, "ArconnectSigner", { enumerable: true, get: function () { return arbundles_1.ArconnectSigner; } });
|
22
21
|
Object.defineProperty(exports, "ArweaveSigner", { enumerable: true, get: function () { return arbundles_1.ArweaveSigner; } });
|
23
22
|
Object.defineProperty(exports, "EthereumSigner", { enumerable: true, get: function () { return arbundles_1.EthereumSigner; } });
|
24
23
|
Object.defineProperty(exports, "HexSolanaSigner", { enumerable: true, get: function () { return arbundles_1.HexSolanaSigner; } });
|
25
24
|
const node_buffer_1 = require("node:buffer");
|
25
|
+
const node_stream_1 = require("node:stream");
|
26
26
|
const signer_js_1 = require("../common/signer.js");
|
27
27
|
const base64_js_1 = require("../utils/base64.js");
|
28
28
|
/**
|
@@ -35,7 +35,9 @@ class TurboNodeSigner extends signer_js_1.TurboDataItemAbstractSigner {
|
|
35
35
|
async signDataItem({ fileStreamFactory, fileSizeFactory, dataItemOpts, }) {
|
36
36
|
// TODO: replace with our own signer implementation
|
37
37
|
this.logger.debug('Signing data item...');
|
38
|
-
|
38
|
+
let [stream1, stream2] = [fileStreamFactory(), fileStreamFactory()];
|
39
|
+
stream1 = stream1 instanceof node_buffer_1.Buffer ? node_stream_1.Readable.from(stream1) : stream1;
|
40
|
+
stream2 = stream2 instanceof node_buffer_1.Buffer ? node_stream_1.Readable.from(stream2) : stream2;
|
39
41
|
const signedDataItem = await (0, arbundles_1.streamSigner)(stream1, stream2, this.signer, dataItemOpts);
|
40
42
|
this.logger.debug('Successfully signed data item...');
|
41
43
|
// TODO: support target, anchor, and tags
|
package/lib/cjs/node/upload.js
CHANGED
@@ -2,20 +2,19 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboAuthenticatedUploadService = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
19
|
const fs_1 = require("fs");
|
21
20
|
const mime_types_1 = require("mime-types");
|
@@ -28,20 +28,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.createAxiosInstance = exports.defaultRequestHeaders = void 0;
|
30
30
|
/**
|
31
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
31
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
32
32
|
*
|
33
|
-
*
|
34
|
-
*
|
35
|
-
*
|
36
|
-
* (at your option) any later version.
|
33
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
34
|
+
* you may not use this file except in compliance with the License.
|
35
|
+
* You may obtain a copy of the License at
|
37
36
|
*
|
38
|
-
*
|
39
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
40
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
41
|
-
* GNU Affero General Public License for more details.
|
37
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
42
38
|
*
|
43
|
-
*
|
44
|
-
*
|
39
|
+
* Unless required by applicable law or agreed to in writing, software
|
40
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
41
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
42
|
+
* See the License for the specific language governing permissions and
|
43
|
+
* limitations under the License.
|
45
44
|
*/
|
46
45
|
const axios_1 = __importStar(require("axios"));
|
47
46
|
const axios_retry_1 = __importDefault(require("axios-retry"));
|
package/lib/cjs/utils/base64.js
CHANGED
@@ -7,20 +7,19 @@ exports.fromB64Url = fromB64Url;
|
|
7
7
|
exports.toB64Url = toB64Url;
|
8
8
|
exports.sha256B64Url = sha256B64Url;
|
9
9
|
/**
|
10
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
10
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
11
11
|
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
* (at your option) any later version.
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
13
|
+
* you may not use this file except in compliance with the License.
|
14
|
+
* You may obtain a copy of the License at
|
16
15
|
*
|
17
|
-
*
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20
|
-
* GNU Affero General Public License for more details.
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
21
17
|
*
|
22
|
-
*
|
23
|
-
*
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
21
|
+
* See the License for the specific language governing permissions and
|
22
|
+
* limitations under the License.
|
24
23
|
*/
|
25
24
|
const utils_js_1 = require("arweave/node/lib/utils.js");
|
26
25
|
const crypto_1 = require("crypto");
|
package/lib/cjs/utils/common.js
CHANGED
@@ -6,25 +6,24 @@ exports.createTurboSigner = createTurboSigner;
|
|
6
6
|
exports.signerFromKyvePrivateKey = signerFromKyvePrivateKey;
|
7
7
|
exports.signerFromKyveMnemonic = signerFromKyveMnemonic;
|
8
8
|
/**
|
9
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
9
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
10
10
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
* (at your option) any later version.
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
12
|
+
* you may not use this file except in compliance with the License.
|
13
|
+
* You may obtain a copy of the License at
|
15
14
|
*
|
16
|
-
*
|
17
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
-
* GNU Affero General Public License for more details.
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
20
16
|
*
|
21
|
-
*
|
22
|
-
*
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20
|
+
* See the License for the specific language governing permissions and
|
21
|
+
* limitations under the License.
|
23
22
|
*/
|
24
|
-
const arbundles_1 = require("@ar.io/arbundles");
|
25
23
|
const amino_1 = require("@cosmjs/amino");
|
26
24
|
const crypto_1 = require("@cosmjs/crypto");
|
27
25
|
const encoding_1 = require("@cosmjs/encoding");
|
26
|
+
const arbundles_1 = require("@dha-team/arbundles");
|
28
27
|
const types_js_1 = require("../types.js");
|
29
28
|
function sleep(ms) {
|
30
29
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
package/lib/cjs/utils/errors.js
CHANGED
@@ -2,20 +2,19 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ProvidedInputError = exports.FailedRequestError = exports.UnauthenticatedRequestError = exports.BaseError = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
19
|
class BaseError extends Error {
|
21
20
|
constructor(message) {
|
@@ -2,20 +2,19 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.readableStreamToBuffer = readableStreamToBuffer;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
19
|
const node_buffer_1 = require("node:buffer");
|
21
20
|
async function readableStreamToBuffer({ stream, size, }) {
|
package/lib/cjs/version.js
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
"use strict";
|
2
2
|
/**
|
3
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
3
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
4
4
|
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* (at your option) any later version.
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
9
8
|
*
|
10
|
-
*
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
* GNU Affero General Public License for more details.
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
10
|
*
|
15
|
-
*
|
16
|
-
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
17
16
|
*/
|
18
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
19
18
|
exports.version = void 0;
|
20
19
|
// AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
|
21
|
-
exports.version = '1.
|
20
|
+
exports.version = '1.18.0-alpha.2';
|
package/lib/cjs/web/factory.js
CHANGED
@@ -2,22 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboFactory = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
|
-
const arbundles_1 = require("@
|
19
|
+
const arbundles_1 = require("@dha-team/arbundles");
|
21
20
|
const factory_js_1 = require("../common/factory.js");
|
22
21
|
const index_js_1 = require("../common/index.js");
|
23
22
|
const common_js_1 = require("../utils/common.js");
|
package/lib/cjs/web/index.js
CHANGED
@@ -15,20 +15,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
/**
|
18
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
18
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
19
19
|
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
* (at your option) any later version.
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
21
|
+
* you may not use this file except in compliance with the License.
|
22
|
+
* You may obtain a copy of the License at
|
24
23
|
*
|
25
|
-
*
|
26
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28
|
-
* GNU Affero General Public License for more details.
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
29
25
|
*
|
30
|
-
*
|
31
|
-
*
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
29
|
+
* See the License for the specific language governing permissions and
|
30
|
+
* limitations under the License.
|
32
31
|
*/
|
33
32
|
__exportStar(require("./factory.js"), exports);
|
34
33
|
__exportStar(require("./upload.js"), exports);
|
package/lib/cjs/web/signer.js
CHANGED
@@ -2,22 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboWebArweaveSigner = exports.HexSolanaSigner = exports.EthereumSigner = exports.ArweaveSigner = exports.ArconnectSigner = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
|
-
const arbundles_1 = require("@
|
19
|
+
const arbundles_1 = require("@dha-team/arbundles");
|
21
20
|
Object.defineProperty(exports, "ArconnectSigner", { enumerable: true, get: function () { return arbundles_1.ArconnectSigner; } });
|
22
21
|
Object.defineProperty(exports, "ArweaveSigner", { enumerable: true, get: function () { return arbundles_1.ArweaveSigner; } });
|
23
22
|
Object.defineProperty(exports, "EthereumSigner", { enumerable: true, get: function () { return arbundles_1.EthereumSigner; } });
|
@@ -44,11 +43,14 @@ class TurboWebArweaveSigner extends signer_js_1.TurboDataItemAbstractSigner {
|
|
44
43
|
}
|
45
44
|
async signDataItem({ fileStreamFactory, fileSizeFactory, dataItemOpts, }) {
|
46
45
|
await this.setPublicKey();
|
46
|
+
const fileStream = fileStreamFactory();
|
47
47
|
// TODO: converts the readable stream to a buffer bc incrementally signing ReadableStreams is not trivial
|
48
|
-
const buffer =
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
const buffer = fileStream instanceof Buffer
|
49
|
+
? fileStream
|
50
|
+
: await (0, readableStream_js_1.readableStreamToBuffer)({
|
51
|
+
stream: fileStream,
|
52
|
+
size: fileSizeFactory(),
|
53
|
+
});
|
52
54
|
this.logger.debug('Signing data item...');
|
53
55
|
const signedDataItem = (0, arbundles_1.createData)(buffer, this.signer, dataItemOpts);
|
54
56
|
await signedDataItem.sign(this.signer);
|
package/lib/cjs/web/upload.js
CHANGED
@@ -2,20 +2,19 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TurboAuthenticatedUploadService = void 0;
|
4
4
|
/**
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
5
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* (at your option) any later version.
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
11
10
|
*
|
12
|
-
*
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
* GNU Affero General Public License for more details.
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
12
|
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
19
18
|
*/
|
20
19
|
const upload_js_1 = require("../common/upload.js");
|
21
20
|
const types_js_1 = require("../types.js");
|
@@ -1,18 +1,17 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
3
3
|
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* (at your option) any later version.
|
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
|
8
7
|
*
|
9
|
-
*
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
* GNU Affero General Public License for more details.
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
9
|
*
|
14
|
-
*
|
15
|
-
*
|
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.
|
16
15
|
*/
|
17
16
|
import { TurboFactory } from '../../node/factory.js';
|
18
17
|
import { addressOrPrivateKeyFromOptions, configFromOptions } from '../utils.js';
|
@@ -1,18 +1,17 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
3
3
|
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* (at your option) any later version.
|
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
|
8
7
|
*
|
9
|
-
*
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
* GNU Affero General Public License for more details.
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
9
|
*
|
14
|
-
*
|
15
|
-
*
|
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.
|
16
15
|
*/
|
17
16
|
import prompts from 'prompts';
|
18
17
|
import { tokenToBaseMap } from '../../common/index.js';
|