@ardrive/turbo-sdk 1.20.0 → 1.20.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/README.md +9 -0
- package/bundles/web.bundle.min.js +9 -4
- package/lib/cjs/common/token/arweave.js +5 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/token/arweave.js +6 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/common/token/arweave.d.ts +3 -3
- package/lib/types/common/token/arweave.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -20,6 +20,7 @@ Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionality for interac
|
|
20
20
|
- [ESM](#esm)
|
21
21
|
- [Typescript](#typescript)
|
22
22
|
- [Examples](#examples)
|
23
|
+
- [Logging](#logging)
|
23
24
|
- [APIs](#apis)
|
24
25
|
- [TurboFactory](#turbofactory)
|
25
26
|
- [`unauthenticated()`](#unauthenticated)
|
@@ -227,6 +228,14 @@ Examples are available in the [examples] directory. To run examples:
|
|
227
228
|
- `yarn example:cjs` - runs example CJS node script
|
228
229
|
- `yarn example:esm` - runs example ESM node script
|
229
230
|
|
231
|
+
## Logging
|
232
|
+
|
233
|
+
The SDK uses winston for logging. You can set the log level using the `setLogLevel` method.
|
234
|
+
|
235
|
+
```typescript
|
236
|
+
TurboFactory.setLogLevel('debug');
|
237
|
+
```
|
238
|
+
|
230
239
|
## APIs
|
231
240
|
|
232
241
|
### TurboFactory
|
@@ -79906,7 +79906,7 @@ var require_common = __commonJS({
|
|
79906
79906
|
var silo_1 = require_silo();
|
79907
79907
|
var chunks_1 = require_chunks();
|
79908
79908
|
var blocks_1 = require_blocks();
|
79909
|
-
var
|
79909
|
+
var Arweave = class _Arweave {
|
79910
79910
|
api;
|
79911
79911
|
wallets;
|
79912
79912
|
transactions;
|
@@ -80017,7 +80017,7 @@ var require_common = __commonJS({
|
|
80017
80017
|
return this.api.post("/arql", query).then((response) => response.data || []);
|
80018
80018
|
}
|
80019
80019
|
};
|
80020
|
-
exports15.default =
|
80020
|
+
exports15.default = Arweave;
|
80021
80021
|
}
|
80022
80022
|
});
|
80023
80023
|
|
@@ -310551,7 +310551,7 @@ var import_winston = __toESM(require_winston(), 1);
|
|
310551
310551
|
init_dirname();
|
310552
310552
|
init_buffer2();
|
310553
310553
|
init_process2();
|
310554
|
-
var version16 = "1.20.
|
310554
|
+
var version16 = "1.20.1-alpha.1";
|
310555
310555
|
|
310556
310556
|
// src/common/logger.ts
|
310557
310557
|
var TurboWinstonLogger = class _TurboWinstonLogger {
|
@@ -315088,6 +315088,11 @@ function signerFromKyvePrivateKey(privateKey) {
|
|
315088
315088
|
}
|
315089
315089
|
|
315090
315090
|
// src/common/token/arweave.ts
|
315091
|
+
var ArweaveClass = (
|
315092
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
315093
|
+
// @ts-ignore -- Access the correct class constructor for Arweave
|
315094
|
+
import_arweave.default.default?.default || import_arweave.default.default || import_arweave.default
|
315095
|
+
);
|
315091
315096
|
var ArweaveToken = class {
|
315092
315097
|
constructor({
|
315093
315098
|
gatewayUrl = "https://arweave.net",
|
@@ -315101,7 +315106,7 @@ var ArweaveToken = class {
|
|
315101
315106
|
}
|
315102
315107
|
} = {}) {
|
315103
315108
|
const url = new URL(gatewayUrl);
|
315104
|
-
this.arweave = arweave ?? new
|
315109
|
+
this.arweave = arweave ?? new ArweaveClass({
|
315105
315110
|
host: url.hostname,
|
315106
315111
|
port: url.port,
|
315107
315112
|
protocol: url.protocol.replace(":", "")
|
@@ -25,6 +25,10 @@ const node_buffer_1 = require("node:buffer");
|
|
25
25
|
const base64_js_1 = require("../../utils/base64.js");
|
26
26
|
const common_js_1 = require("../../utils/common.js");
|
27
27
|
const logger_js_1 = require("../logger.js");
|
28
|
+
const ArweaveClass =
|
29
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
30
|
+
// @ts-ignore -- Access the correct class constructor for Arweave
|
31
|
+
arweave_1.default.default?.default || arweave_1.default.default || arweave_1.default;
|
28
32
|
class ArweaveToken {
|
29
33
|
constructor({ gatewayUrl = 'https://arweave.net', arweave, logger = logger_js_1.TurboWinstonLogger.default, mintU = true, pollingOptions = {
|
30
34
|
maxAttempts: 10,
|
@@ -34,7 +38,7 @@ class ArweaveToken {
|
|
34
38
|
const url = new URL(gatewayUrl);
|
35
39
|
this.arweave =
|
36
40
|
arweave ??
|
37
|
-
new
|
41
|
+
new ArweaveClass({
|
38
42
|
host: url.hostname,
|
39
43
|
port: url.port,
|
40
44
|
protocol: url.protocol.replace(':', ''),
|
package/lib/cjs/version.js
CHANGED
@@ -13,12 +13,16 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import
|
16
|
+
import ArweaveModule from 'arweave';
|
17
17
|
import { BigNumber } from 'bignumber.js';
|
18
18
|
import { Buffer } from 'node:buffer';
|
19
19
|
import { sha256B64Url, toB64Url } from '../../utils/base64.js';
|
20
20
|
import { sleep } from '../../utils/common.js';
|
21
21
|
import { TurboWinstonLogger } from '../logger.js';
|
22
|
+
const ArweaveClass =
|
23
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
24
|
+
// @ts-ignore -- Access the correct class constructor for Arweave
|
25
|
+
ArweaveModule.default?.default || ArweaveModule.default || ArweaveModule;
|
22
26
|
export class ArweaveToken {
|
23
27
|
constructor({ gatewayUrl = 'https://arweave.net', arweave, logger = TurboWinstonLogger.default, mintU = true, pollingOptions = {
|
24
28
|
maxAttempts: 10,
|
@@ -28,7 +32,7 @@ export class ArweaveToken {
|
|
28
32
|
const url = new URL(gatewayUrl);
|
29
33
|
this.arweave =
|
30
34
|
arweave ??
|
31
|
-
new
|
35
|
+
new ArweaveClass({
|
32
36
|
host: url.hostname,
|
33
37
|
port: url.port,
|
34
38
|
protocol: url.protocol.replace(':', ''),
|
package/lib/esm/version.js
CHANGED
@@ -13,17 +13,17 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import
|
16
|
+
import ArweaveModule from 'arweave';
|
17
17
|
import { BigNumber } from 'bignumber.js';
|
18
18
|
import { TokenCreateTxParams, TokenPollingOptions, TokenTools, TurboLogger } from '../../types.js';
|
19
19
|
export declare class ArweaveToken implements TokenTools {
|
20
20
|
protected logger: TurboLogger;
|
21
|
-
protected arweave:
|
21
|
+
protected arweave: ArweaveModule;
|
22
22
|
protected mintU: boolean;
|
23
23
|
protected pollingOptions: TokenPollingOptions;
|
24
24
|
constructor({ gatewayUrl, arweave, logger, mintU, pollingOptions, }?: {
|
25
25
|
gatewayUrl?: string;
|
26
|
-
arweave?:
|
26
|
+
arweave?: ArweaveModule;
|
27
27
|
logger?: TurboLogger;
|
28
28
|
mintU?: boolean;
|
29
29
|
pollingOptions?: TokenPollingOptions;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"arweave.d.ts","sourceRoot":"","sources":["../../../../src/common/token/arweave.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
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;AAGzC,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,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