@ardrive/turbo-sdk 1.28.3 → 1.29.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/bundles/web.bundle.min.js +46 -15
- package/lib/cjs/cli/cli.js +45 -0
- package/lib/cjs/common/http.js +46 -1
- package/lib/cjs/common/token/baseEth.js +2 -17
- package/lib/cjs/common/token/ethereum.js +2 -2
- package/lib/cjs/common/token/kyve.js +4 -4
- package/lib/cjs/common/token/polygon.js +2 -17
- package/lib/cjs/common/token/solana.js +4 -4
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +45 -0
- package/lib/esm/common/http.js +46 -1
- package/lib/esm/common/token/baseEth.js +1 -16
- package/lib/esm/common/token/ethereum.js +1 -1
- package/lib/esm/common/token/kyve.js +1 -1
- package/lib/esm/common/token/polygon.js +1 -16
- package/lib/esm/common/token/solana.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/common/http.d.ts.map +1 -1
- package/lib/types/common/token/baseEth.d.ts +15 -0
- package/lib/types/common/token/baseEth.d.ts.map +1 -1
- package/lib/types/common/token/ethereum.d.ts.map +1 -1
- package/lib/types/common/token/kyve.d.ts.map +1 -1
- package/lib/types/common/token/polygon.d.ts +15 -0
- package/lib/types/common/token/polygon.d.ts.map +1 -1
- package/lib/types/common/token/solana.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -220959,7 +220959,7 @@ var import_winston = __toESM(require_winston(), 1);
|
|
|
220959
220959
|
init_dirname();
|
|
220960
220960
|
init_buffer2();
|
|
220961
220961
|
init_process2();
|
|
220962
|
-
var version21 = "1.
|
|
220962
|
+
var version21 = "1.29.0-alpha.1";
|
|
220963
220963
|
|
|
220964
220964
|
// src/common/logger.ts
|
|
220965
220965
|
var TurboWinstonLogger = class _TurboWinstonLogger {
|
|
@@ -225535,10 +225535,44 @@ var TurboHTTPService = class {
|
|
|
225535
225535
|
headers,
|
|
225536
225536
|
data
|
|
225537
225537
|
}) {
|
|
225538
|
-
|
|
225539
|
-
|
|
225540
|
-
|
|
225541
|
-
|
|
225538
|
+
if (!(data instanceof ReadableStream)) {
|
|
225539
|
+
return this.tryRequest(
|
|
225540
|
+
() => this.axios.post(endpoint, data, { headers, signal }),
|
|
225541
|
+
allowedStatuses
|
|
225542
|
+
);
|
|
225543
|
+
}
|
|
225544
|
+
const { body, duplex } = await toFetchBody(data);
|
|
225545
|
+
try {
|
|
225546
|
+
const res = await fetch(this.axios.defaults.baseURL + endpoint, {
|
|
225547
|
+
method: "POST",
|
|
225548
|
+
headers,
|
|
225549
|
+
body,
|
|
225550
|
+
signal,
|
|
225551
|
+
...duplex ? { duplex } : {}
|
|
225552
|
+
// Use duplex only where streams are working
|
|
225553
|
+
});
|
|
225554
|
+
if (!allowedStatuses.includes(res.status)) {
|
|
225555
|
+
const errorText = await res.text();
|
|
225556
|
+
throw new FailedRequestError(
|
|
225557
|
+
// Return error message from server if available
|
|
225558
|
+
errorText || res.statusText,
|
|
225559
|
+
res.status
|
|
225560
|
+
);
|
|
225561
|
+
}
|
|
225562
|
+
return res.json();
|
|
225563
|
+
} catch (error) {
|
|
225564
|
+
if (error instanceof FailedRequestError) {
|
|
225565
|
+
throw error;
|
|
225566
|
+
}
|
|
225567
|
+
if (error.message.includes("The operation was aborted")) {
|
|
225568
|
+
throw new CanceledError2();
|
|
225569
|
+
}
|
|
225570
|
+
this.logger.error("Error posting data", { endpoint, error });
|
|
225571
|
+
throw new FailedRequestError(
|
|
225572
|
+
error instanceof Error ? error.message : "Unknown error",
|
|
225573
|
+
error.response?.status
|
|
225574
|
+
);
|
|
225575
|
+
}
|
|
225542
225576
|
}
|
|
225543
225577
|
async tryRequest(request3, allowedStatuses) {
|
|
225544
225578
|
try {
|
|
@@ -225561,6 +225595,13 @@ var TurboHTTPService = class {
|
|
|
225561
225595
|
}
|
|
225562
225596
|
}
|
|
225563
225597
|
};
|
|
225598
|
+
async function toFetchBody(data) {
|
|
225599
|
+
if (!navigator.userAgent.includes("Firefox") && !navigator.userAgent.includes("Safari")) {
|
|
225600
|
+
return { body: data, duplex: "half" };
|
|
225601
|
+
}
|
|
225602
|
+
const blob3 = await new Response(data).blob();
|
|
225603
|
+
return { body: blob3 };
|
|
225604
|
+
}
|
|
225564
225605
|
|
|
225565
225606
|
// src/common/token/index.ts
|
|
225566
225607
|
init_dirname();
|
|
@@ -239414,16 +239455,6 @@ init_dirname();
|
|
|
239414
239455
|
init_buffer2();
|
|
239415
239456
|
init_process2();
|
|
239416
239457
|
|
|
239417
|
-
// src/cli/constants.ts
|
|
239418
|
-
init_dirname();
|
|
239419
|
-
init_buffer2();
|
|
239420
|
-
init_process2();
|
|
239421
|
-
var turboCliTags = [
|
|
239422
|
-
{ name: "App-Name", value: "Turbo-CLI" },
|
|
239423
|
-
{ name: "App-Version", value: version21 },
|
|
239424
|
-
{ name: "App-Platform", value: process_exports?.platform }
|
|
239425
|
-
];
|
|
239426
|
-
|
|
239427
239458
|
// src/common/token/ethereum.ts
|
|
239428
239459
|
init_dirname();
|
|
239429
239460
|
init_buffer2();
|
package/lib/cjs/cli/cli.js
CHANGED
|
@@ -18,7 +18,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
// eslint-disable-next-line header/header -- This is a CLI file
|
|
21
|
+
const arbundles_1 = require("@dha-team/arbundles");
|
|
21
22
|
const commander_1 = require("commander");
|
|
23
|
+
const fs_1 = require("fs");
|
|
22
24
|
const version_js_1 = require("../version.js");
|
|
23
25
|
const fiatEstimate_js_1 = require("./commands/fiatEstimate.js");
|
|
24
26
|
const index_js_1 = require("./commands/index.js");
|
|
@@ -78,6 +80,49 @@ const utils_js_1 = require("./utils.js");
|
|
|
78
80
|
.description('Lists all given or received Turbo credit share approvals for specified address or connected wallet'), options_js_1.listSharesOptions).action(async (_commandOptions, command) => {
|
|
79
81
|
await (0, utils_js_1.runCommand)(command, listShares_js_1.listShares);
|
|
80
82
|
});
|
|
83
|
+
(0, utils_js_1.applyOptions)(commander_1.program
|
|
84
|
+
.command('inspect-data-items')
|
|
85
|
+
.description('Lists all given or received Turbo credit share approvals for specified address or connected wallet'), [options_js_1.optionMap.folderPath]).action(async (_commandOptions, command) => {
|
|
86
|
+
await (0, utils_js_1.runCommand)(command, async (options) => {
|
|
87
|
+
const folderPath = options.folderPath ?? './maybe-broke';
|
|
88
|
+
// read directory /maybe-broken-data-items and check all files within to see if can read
|
|
89
|
+
const dir = (0, fs_1.readdirSync)(folderPath);
|
|
90
|
+
// const data = await axios.get('https://arweave.net/raw/' + options.txId); // TODO: Gateway that gives raw data items
|
|
91
|
+
const validDataItemStats = [];
|
|
92
|
+
const invalidDataItemIds = [];
|
|
93
|
+
for (const file of dir) {
|
|
94
|
+
const data = (0, fs_1.readFileSync)('./maybe-broke/' + file);
|
|
95
|
+
try {
|
|
96
|
+
const dataItem = new arbundles_1.DataItem(data);
|
|
97
|
+
const id = dataItem.id;
|
|
98
|
+
console.log('id', id);
|
|
99
|
+
const isValid = await dataItem.isValid().catch((e) => {
|
|
100
|
+
console.log('error', e);
|
|
101
|
+
});
|
|
102
|
+
if (!isValid) {
|
|
103
|
+
invalidDataItemIds.push(id);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const size = dataItem.getRaw().byteLength;
|
|
107
|
+
const dataStart = dataItem.getStartOfData();
|
|
108
|
+
validDataItemStats.push({
|
|
109
|
+
id,
|
|
110
|
+
size,
|
|
111
|
+
dataStart,
|
|
112
|
+
signatureType: dataItem.signatureType,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
console.log('error', e);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
console.log(JSON.stringify({
|
|
120
|
+
validDataItemStats,
|
|
121
|
+
invalidDataItemIds,
|
|
122
|
+
validDataItemIds: validDataItemStats.map((item) => item.id),
|
|
123
|
+
}, null, 2));
|
|
124
|
+
});
|
|
125
|
+
});
|
|
81
126
|
if (process.argv[1].includes('bin/turbo') || // Running from global .bin
|
|
82
127
|
process.argv[1].includes('cli/cli') // Running from source
|
|
83
128
|
) {
|
package/lib/cjs/common/http.js
CHANGED
|
@@ -35,7 +35,43 @@ class TurboHTTPService {
|
|
|
35
35
|
return this.tryRequest(() => this.axios.get(endpoint, { headers, signal }), allowedStatuses);
|
|
36
36
|
}
|
|
37
37
|
async post({ endpoint, signal, allowedStatuses = [200, 202], headers, data, }) {
|
|
38
|
-
|
|
38
|
+
// Buffer and Readable → keep Axios (streams work fine there)
|
|
39
|
+
if (!(data instanceof ReadableStream)) {
|
|
40
|
+
return this.tryRequest(() => this.axios.post(endpoint, data, { headers, signal }), allowedStatuses);
|
|
41
|
+
}
|
|
42
|
+
// Browser ReadableStream → use fetch with progressive enhancement of duplex
|
|
43
|
+
// Note: fetch does not support streams in Safari and Firefox, so we convert to Blob
|
|
44
|
+
// and use the `duplex` option only in browsers that support it (Chrome, Edge, Opera).
|
|
45
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#body
|
|
46
|
+
const { body, duplex } = await toFetchBody(data);
|
|
47
|
+
try {
|
|
48
|
+
const res = await fetch(this.axios.defaults.baseURL + endpoint, {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers,
|
|
51
|
+
body,
|
|
52
|
+
signal,
|
|
53
|
+
...(duplex ? { duplex } : {}), // Use duplex only where streams are working
|
|
54
|
+
});
|
|
55
|
+
if (!allowedStatuses.includes(res.status)) {
|
|
56
|
+
const errorText = await res.text();
|
|
57
|
+
throw new errors_js_1.FailedRequestError(
|
|
58
|
+
// Return error message from server if available
|
|
59
|
+
errorText || res.statusText, res.status);
|
|
60
|
+
}
|
|
61
|
+
return res.json();
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (error instanceof errors_js_1.FailedRequestError) {
|
|
65
|
+
throw error; // rethrow FailedRequestError
|
|
66
|
+
}
|
|
67
|
+
// Handle CanceledError specifically
|
|
68
|
+
if (error.message.includes('The operation was aborted')) {
|
|
69
|
+
throw new axios_1.CanceledError();
|
|
70
|
+
}
|
|
71
|
+
// Log the error and throw a FailedRequestError
|
|
72
|
+
this.logger.error('Error posting data', { endpoint, error });
|
|
73
|
+
throw new errors_js_1.FailedRequestError(error instanceof Error ? error.message : 'Unknown error', error.response?.status);
|
|
74
|
+
}
|
|
39
75
|
}
|
|
40
76
|
async tryRequest(request, allowedStatuses) {
|
|
41
77
|
try {
|
|
@@ -60,3 +96,12 @@ class TurboHTTPService {
|
|
|
60
96
|
}
|
|
61
97
|
}
|
|
62
98
|
exports.TurboHTTPService = TurboHTTPService;
|
|
99
|
+
async function toFetchBody(data) {
|
|
100
|
+
if (!navigator.userAgent.includes('Firefox') &&
|
|
101
|
+
!navigator.userAgent.includes('Safari')) {
|
|
102
|
+
return { body: data, duplex: 'half' }; // Chrome / Edge / Opera
|
|
103
|
+
}
|
|
104
|
+
// Firefox / Safari fallback: stream → Blob
|
|
105
|
+
const blob = await new Response(data).blob();
|
|
106
|
+
return { body: blob }; // browser sets length
|
|
107
|
+
}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseEthToken = void 0;
|
|
4
|
-
|
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
6
|
-
*
|
|
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
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
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.
|
|
18
|
-
*/
|
|
19
|
-
const constants_js_1 = require("../../cli/constants.js");
|
|
4
|
+
const common_js_1 = require("../../utils/common.js");
|
|
20
5
|
const ethereum_js_1 = require("./ethereum.js");
|
|
21
6
|
class BaseEthToken extends ethereum_js_1.EthereumToken {
|
|
22
|
-
constructor({ logger, gatewayUrl =
|
|
7
|
+
constructor({ logger, gatewayUrl = common_js_1.defaultProdGatewayUrls['base-eth'], pollingOptions = {
|
|
23
8
|
initialBackoffMs: 1_000,
|
|
24
9
|
maxAttempts: 10,
|
|
25
10
|
pollingIntervalMs: 2_500,
|
|
@@ -18,14 +18,14 @@ exports.EthereumToken = exports.ETHToTokenAmount = exports.weiToTokenAmount = vo
|
|
|
18
18
|
*/
|
|
19
19
|
const bignumber_js_1 = require("bignumber.js");
|
|
20
20
|
const ethers_1 = require("ethers");
|
|
21
|
-
const
|
|
21
|
+
const common_js_1 = require("../../utils/common.js");
|
|
22
22
|
const logger_js_1 = require("../logger.js");
|
|
23
23
|
const weiToTokenAmount = (wei) => wei;
|
|
24
24
|
exports.weiToTokenAmount = weiToTokenAmount;
|
|
25
25
|
const ETHToTokenAmount = (eth) => new bignumber_js_1.BigNumber(eth).times(1e18).valueOf();
|
|
26
26
|
exports.ETHToTokenAmount = ETHToTokenAmount;
|
|
27
27
|
class EthereumToken {
|
|
28
|
-
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl =
|
|
28
|
+
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl = common_js_1.defaultProdGatewayUrls.ethereum, pollingOptions = {
|
|
29
29
|
maxAttempts: 10,
|
|
30
30
|
pollingIntervalMs: 4_000,
|
|
31
31
|
initialBackoffMs: 10_000,
|
|
@@ -26,9 +26,9 @@ const proto_signing_1 = require("@cosmjs/proto-signing");
|
|
|
26
26
|
const stargate_1 = require("@cosmjs/stargate");
|
|
27
27
|
const arbundles_1 = require("@dha-team/arbundles");
|
|
28
28
|
const bignumber_js_1 = require("bignumber.js");
|
|
29
|
-
const constants_js_1 = require("../../cli/constants.js");
|
|
30
29
|
const axiosClient_js_1 = require("../../utils/axiosClient.js");
|
|
31
30
|
const common_js_1 = require("../../utils/common.js");
|
|
31
|
+
const common_js_2 = require("../../utils/common.js");
|
|
32
32
|
const logger_js_1 = require("../logger.js");
|
|
33
33
|
function hasKyveTxResponse(response) {
|
|
34
34
|
return response.tx_response !== undefined;
|
|
@@ -38,7 +38,7 @@ exports.ukyveToTokenAmount = ukyveToTokenAmount;
|
|
|
38
38
|
const KYVEToTokenAmount = (sol) => new bignumber_js_1.BigNumber(sol).times(1e6).valueOf();
|
|
39
39
|
exports.KYVEToTokenAmount = KYVEToTokenAmount;
|
|
40
40
|
class KyveToken {
|
|
41
|
-
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl =
|
|
41
|
+
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl = common_js_1.defaultProdGatewayUrls.kyve, pollingOptions = {
|
|
42
42
|
maxAttempts: 5,
|
|
43
43
|
pollingIntervalMs: 1_000,
|
|
44
44
|
initialBackoffMs: 500,
|
|
@@ -72,7 +72,7 @@ class KyveToken {
|
|
|
72
72
|
txId,
|
|
73
73
|
pollingOptions: this.pollingOptions,
|
|
74
74
|
});
|
|
75
|
-
await (0,
|
|
75
|
+
await (0, common_js_2.sleep)(initialBackoffMs);
|
|
76
76
|
let attempts = 0;
|
|
77
77
|
while (attempts < maxAttempts) {
|
|
78
78
|
let res = undefined;
|
|
@@ -100,7 +100,7 @@ class KyveToken {
|
|
|
100
100
|
maxAttempts,
|
|
101
101
|
pollingIntervalMs,
|
|
102
102
|
});
|
|
103
|
-
await (0,
|
|
103
|
+
await (0, common_js_2.sleep)(pollingIntervalMs);
|
|
104
104
|
}
|
|
105
105
|
throw new Error('Transaction not found after polling, transaction id: ' + txId);
|
|
106
106
|
}
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PolygonToken = exports.POLToTokenAmount = void 0;
|
|
4
|
-
|
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
6
|
-
*
|
|
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
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
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.
|
|
18
|
-
*/
|
|
19
|
-
const constants_js_1 = require("../../cli/constants.js");
|
|
4
|
+
const common_js_1 = require("../../utils/common.js");
|
|
20
5
|
const logger_js_1 = require("../logger.js");
|
|
21
6
|
const ethereum_js_1 = require("./ethereum.js");
|
|
22
7
|
exports.POLToTokenAmount = ethereum_js_1.ETHToTokenAmount;
|
|
23
8
|
class PolygonToken extends ethereum_js_1.EthereumToken {
|
|
24
|
-
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl =
|
|
9
|
+
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl = common_js_1.defaultProdGatewayUrls.pol, pollingOptions = {
|
|
25
10
|
maxAttempts: 10,
|
|
26
11
|
pollingIntervalMs: 4_000,
|
|
27
12
|
initialBackoffMs: 5_000,
|
|
@@ -22,15 +22,15 @@ exports.SolanaToken = exports.SOLToTokenAmount = exports.lamportToTokenAmount =
|
|
|
22
22
|
const web3_js_1 = require("@solana/web3.js");
|
|
23
23
|
const bignumber_js_1 = require("bignumber.js");
|
|
24
24
|
const bs58_1 = __importDefault(require("bs58"));
|
|
25
|
-
const constants_js_1 = require("../../cli/constants.js");
|
|
26
25
|
const common_js_1 = require("../../utils/common.js");
|
|
26
|
+
const common_js_2 = require("../../utils/common.js");
|
|
27
27
|
const logger_js_1 = require("../logger.js");
|
|
28
28
|
const lamportToTokenAmount = (winston) => winston;
|
|
29
29
|
exports.lamportToTokenAmount = lamportToTokenAmount;
|
|
30
30
|
const SOLToTokenAmount = (sol) => new bignumber_js_1.BigNumber(sol).times(1e9).valueOf();
|
|
31
31
|
exports.SOLToTokenAmount = SOLToTokenAmount;
|
|
32
32
|
class SolanaToken {
|
|
33
|
-
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl =
|
|
33
|
+
constructor({ logger = logger_js_1.TurboWinstonLogger.default, gatewayUrl = common_js_1.defaultProdGatewayUrls.solana, pollingOptions = {
|
|
34
34
|
maxAttempts: 10,
|
|
35
35
|
pollingIntervalMs: 2_500,
|
|
36
36
|
initialBackoffMs: 500,
|
|
@@ -80,7 +80,7 @@ class SolanaToken {
|
|
|
80
80
|
txId,
|
|
81
81
|
pollingOptions: this.pollingOptions,
|
|
82
82
|
});
|
|
83
|
-
await (0,
|
|
83
|
+
await (0, common_js_2.sleep)(initialBackoffMs);
|
|
84
84
|
let attempts = 0;
|
|
85
85
|
while (attempts < maxAttempts) {
|
|
86
86
|
let status = undefined;
|
|
@@ -104,7 +104,7 @@ class SolanaToken {
|
|
|
104
104
|
maxAttempts,
|
|
105
105
|
pollingIntervalMs,
|
|
106
106
|
});
|
|
107
|
-
await (0,
|
|
107
|
+
await (0, common_js_2.sleep)(pollingIntervalMs);
|
|
108
108
|
}
|
|
109
109
|
throw new Error('Transaction not found after polling, transaction id: ' + txId);
|
|
110
110
|
}
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/cli/cli.js
CHANGED
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
// eslint-disable-next-line header/header -- This is a CLI file
|
|
19
|
+
import { DataItem } from '@dha-team/arbundles';
|
|
19
20
|
import { program } from 'commander';
|
|
21
|
+
import { readFileSync, readdirSync } from 'fs';
|
|
20
22
|
import { version } from '../version.js';
|
|
21
23
|
import { fiatEstimate } from './commands/fiatEstimate.js';
|
|
22
24
|
import { balance, cryptoFund, price, topUp, uploadFile, uploadFolder, } from './commands/index.js';
|
|
@@ -76,6 +78,49 @@ applyOptions(program
|
|
|
76
78
|
.description('Lists all given or received Turbo credit share approvals for specified address or connected wallet'), listSharesOptions).action(async (_commandOptions, command) => {
|
|
77
79
|
await runCommand(command, listShares);
|
|
78
80
|
});
|
|
81
|
+
applyOptions(program
|
|
82
|
+
.command('inspect-data-items')
|
|
83
|
+
.description('Lists all given or received Turbo credit share approvals for specified address or connected wallet'), [optionMap.folderPath]).action(async (_commandOptions, command) => {
|
|
84
|
+
await runCommand(command, async (options) => {
|
|
85
|
+
const folderPath = options.folderPath ?? './maybe-broke';
|
|
86
|
+
// read directory /maybe-broken-data-items and check all files within to see if can read
|
|
87
|
+
const dir = readdirSync(folderPath);
|
|
88
|
+
// const data = await axios.get('https://arweave.net/raw/' + options.txId); // TODO: Gateway that gives raw data items
|
|
89
|
+
const validDataItemStats = [];
|
|
90
|
+
const invalidDataItemIds = [];
|
|
91
|
+
for (const file of dir) {
|
|
92
|
+
const data = readFileSync('./maybe-broke/' + file);
|
|
93
|
+
try {
|
|
94
|
+
const dataItem = new DataItem(data);
|
|
95
|
+
const id = dataItem.id;
|
|
96
|
+
console.log('id', id);
|
|
97
|
+
const isValid = await dataItem.isValid().catch((e) => {
|
|
98
|
+
console.log('error', e);
|
|
99
|
+
});
|
|
100
|
+
if (!isValid) {
|
|
101
|
+
invalidDataItemIds.push(id);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const size = dataItem.getRaw().byteLength;
|
|
105
|
+
const dataStart = dataItem.getStartOfData();
|
|
106
|
+
validDataItemStats.push({
|
|
107
|
+
id,
|
|
108
|
+
size,
|
|
109
|
+
dataStart,
|
|
110
|
+
signatureType: dataItem.signatureType,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
console.log('error', e);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
console.log(JSON.stringify({
|
|
118
|
+
validDataItemStats,
|
|
119
|
+
invalidDataItemIds,
|
|
120
|
+
validDataItemIds: validDataItemStats.map((item) => item.id),
|
|
121
|
+
}, null, 2));
|
|
122
|
+
});
|
|
123
|
+
});
|
|
79
124
|
if (process.argv[1].includes('bin/turbo') || // Running from global .bin
|
|
80
125
|
process.argv[1].includes('cli/cli') // Running from source
|
|
81
126
|
) {
|
package/lib/esm/common/http.js
CHANGED
|
@@ -32,7 +32,43 @@ export class TurboHTTPService {
|
|
|
32
32
|
return this.tryRequest(() => this.axios.get(endpoint, { headers, signal }), allowedStatuses);
|
|
33
33
|
}
|
|
34
34
|
async post({ endpoint, signal, allowedStatuses = [200, 202], headers, data, }) {
|
|
35
|
-
|
|
35
|
+
// Buffer and Readable → keep Axios (streams work fine there)
|
|
36
|
+
if (!(data instanceof ReadableStream)) {
|
|
37
|
+
return this.tryRequest(() => this.axios.post(endpoint, data, { headers, signal }), allowedStatuses);
|
|
38
|
+
}
|
|
39
|
+
// Browser ReadableStream → use fetch with progressive enhancement of duplex
|
|
40
|
+
// Note: fetch does not support streams in Safari and Firefox, so we convert to Blob
|
|
41
|
+
// and use the `duplex` option only in browsers that support it (Chrome, Edge, Opera).
|
|
42
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#body
|
|
43
|
+
const { body, duplex } = await toFetchBody(data);
|
|
44
|
+
try {
|
|
45
|
+
const res = await fetch(this.axios.defaults.baseURL + endpoint, {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
headers,
|
|
48
|
+
body,
|
|
49
|
+
signal,
|
|
50
|
+
...(duplex ? { duplex } : {}), // Use duplex only where streams are working
|
|
51
|
+
});
|
|
52
|
+
if (!allowedStatuses.includes(res.status)) {
|
|
53
|
+
const errorText = await res.text();
|
|
54
|
+
throw new FailedRequestError(
|
|
55
|
+
// Return error message from server if available
|
|
56
|
+
errorText || res.statusText, res.status);
|
|
57
|
+
}
|
|
58
|
+
return res.json();
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error instanceof FailedRequestError) {
|
|
62
|
+
throw error; // rethrow FailedRequestError
|
|
63
|
+
}
|
|
64
|
+
// Handle CanceledError specifically
|
|
65
|
+
if (error.message.includes('The operation was aborted')) {
|
|
66
|
+
throw new CanceledError();
|
|
67
|
+
}
|
|
68
|
+
// Log the error and throw a FailedRequestError
|
|
69
|
+
this.logger.error('Error posting data', { endpoint, error });
|
|
70
|
+
throw new FailedRequestError(error instanceof Error ? error.message : 'Unknown error', error.response?.status);
|
|
71
|
+
}
|
|
36
72
|
}
|
|
37
73
|
async tryRequest(request, allowedStatuses) {
|
|
38
74
|
try {
|
|
@@ -56,3 +92,12 @@ export class TurboHTTPService {
|
|
|
56
92
|
}
|
|
57
93
|
}
|
|
58
94
|
}
|
|
95
|
+
async function toFetchBody(data) {
|
|
96
|
+
if (!navigator.userAgent.includes('Firefox') &&
|
|
97
|
+
!navigator.userAgent.includes('Safari')) {
|
|
98
|
+
return { body: data, duplex: 'half' }; // Chrome / Edge / Opera
|
|
99
|
+
}
|
|
100
|
+
// Firefox / Safari fallback: stream → Blob
|
|
101
|
+
const blob = await new Response(data).blob();
|
|
102
|
+
return { body: blob }; // browser sets length
|
|
103
|
+
}
|
|
@@ -1,19 +1,4 @@
|
|
|
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 { defaultProdGatewayUrls } from '../../cli/constants.js';
|
|
1
|
+
import { defaultProdGatewayUrls } from '../../utils/common.js';
|
|
17
2
|
import { EthereumToken } from './ethereum.js';
|
|
18
3
|
export class BaseEthToken extends EthereumToken {
|
|
19
4
|
constructor({ logger, gatewayUrl = defaultProdGatewayUrls['base-eth'], pollingOptions = {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { BigNumber } from 'bignumber.js';
|
|
17
17
|
import { ethers } from 'ethers';
|
|
18
|
-
import { defaultProdGatewayUrls } from '../../
|
|
18
|
+
import { defaultProdGatewayUrls } from '../../utils/common.js';
|
|
19
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();
|
|
@@ -20,8 +20,8 @@ import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing';
|
|
|
20
20
|
import { GasPrice, SigningStargateClient, calculateFee, } from '@cosmjs/stargate';
|
|
21
21
|
import { EthereumSigner } from '@dha-team/arbundles';
|
|
22
22
|
import { BigNumber } from 'bignumber.js';
|
|
23
|
-
import { defaultProdGatewayUrls } from '../../cli/constants.js';
|
|
24
23
|
import { createAxiosInstance } from '../../utils/axiosClient.js';
|
|
24
|
+
import { defaultProdGatewayUrls } from '../../utils/common.js';
|
|
25
25
|
import { sleep } from '../../utils/common.js';
|
|
26
26
|
import { TurboWinstonLogger } from '../logger.js';
|
|
27
27
|
function hasKyveTxResponse(response) {
|
|
@@ -1,19 +1,4 @@
|
|
|
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 { defaultProdGatewayUrls } from '../../cli/constants.js';
|
|
1
|
+
import { defaultProdGatewayUrls } from '../../utils/common.js';
|
|
17
2
|
import { TurboWinstonLogger } from '../logger.js';
|
|
18
3
|
import { ETHToTokenAmount, EthereumToken } from './ethereum.js';
|
|
19
4
|
export const POLToTokenAmount = ETHToTokenAmount;
|
|
@@ -16,7 +16,7 @@
|
|
|
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 { defaultProdGatewayUrls } from '../../
|
|
19
|
+
import { defaultProdGatewayUrls } from '../../utils/common.js';
|
|
20
20
|
import { sleep } from '../../utils/common.js';
|
|
21
21
|
import { TurboWinstonLogger } from '../logger.js';
|
|
22
22
|
export const lamportToTokenAmount = (winston) => winston;
|
package/lib/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/common/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAc,aAAa,EAAgC,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,iBAAi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CAAC;KAC1C,GAAG,OAAO,CAAC,CAAC,CAAC;YAmDA,UAAU;CA0BzB"}
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { TokenConfig } from '../../types.js';
|
|
2
17
|
import { EthereumToken } from './ethereum.js';
|
|
3
18
|
export declare class BaseEthToken extends EthereumToken {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseEth.d.ts","sourceRoot":"","sources":["../../../../src/common/token/baseEth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseEth.d.ts","sourceRoot":"","sources":["../../../../src/common/token/baseEth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,qBAAa,YAAa,SAAQ,aAAa;gBACjC,EACV,MAAM,EACN,UAA+C,EAC/C,cAIC,GACF,GAAE,WAAgB;CAOpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../../../src/common/token/ethereum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../../../src/common/token/ethereum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,gBAAgB,QAAS,SAAS,CAAC,KAAK,oBAAQ,CAAC;AAC9D,eAAO,MAAM,gBAAgB,QAAS,SAAS,CAAC,KAAK,WACX,CAAC;AAE3C,qBAAa,aAAc,YAAW,UAAU;IAC9C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAE9C,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,eAAe,CAAC;gBAElC,EACV,MAAmC,EACnC,UAA4C,EAC5C,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;IAeW,uBAAuB,CAAC,EACnC,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;CAyBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kyve.d.ts","sourceRoot":"","sources":["../../../../src/common/token/kyve.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,SAAS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;;;;;;;;;;;;;;;;;CA6DnC,CAAC"}
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { TokenConfig } from '../../types.js';
|
|
2
17
|
import { EthereumToken } from './ethereum.js';
|
|
3
18
|
export declare const POLToTokenAmount: (eth: import("bignumber.js").BigNumber.Value) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/common/token/polygon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/common/token/polygon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAoB,aAAa,EAAE,MAAM,eAAe,CAAC;AAEhE,eAAO,MAAM,gBAAgB,yDAAmB,CAAC;AAEjD,qBAAa,YAAa,SAAQ,aAAa;gBACjC,EACV,MAAmC,EACnC,UAAuC,EACvC,cAIC,GACF,GAAE,WAAgB;CAGpB"}
|
|
@@ -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;AAGzC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAKxB,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"}
|
package/lib/types/version.d.ts
CHANGED