@ardrive/turbo-sdk 1.21.0 → 1.21.1-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.
@@ -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.2";
310554
+ var version16 = "1.21.0";
310555
310555
 
310556
310556
  // src/common/logger.ts
310557
310557
  var TurboWinstonLogger = class _TurboWinstonLogger {
@@ -350455,9 +350455,29 @@ var TurboWebArweaveSigner = class extends TurboDataItemAbstractSigner {
350455
350455
  stream: fileStream,
350456
350456
  size: fileSizeFactory()
350457
350457
  });
350458
+ let signedDataItem;
350458
350459
  this.logger.debug("Signing data item...");
350459
- const signedDataItem = createData(buffer2, this.signer, dataItemOpts);
350460
- await signedDataItem.sign(this.signer);
350460
+ if (this.signer instanceof InjectedArweaveSigner) {
350461
+ this.logger.debug(
350462
+ "Arconnect signer detected, signing with Arconnect signData Item API..."
350463
+ );
350464
+ const sign6 = Buffer.from(
350465
+ await this.signer["signer"].signDataItem({
350466
+ data: Uint8Array.from(buffer2),
350467
+ tags: dataItemOpts?.tags,
350468
+ target: dataItemOpts?.target,
350469
+ anchor: dataItemOpts?.anchor
350470
+ })
350471
+ );
350472
+ signedDataItem = new DataItem(sign6);
350473
+ } else {
350474
+ signedDataItem = createData(
350475
+ Uint8Array.from(buffer2),
350476
+ this.signer,
350477
+ dataItemOpts
350478
+ );
350479
+ await signedDataItem.sign(this.signer);
350480
+ }
350461
350481
  this.logger.debug("Successfully signed data item...");
350462
350482
  return {
350463
350483
  // while this returns a Buffer - it needs to match our return type for uploading
@@ -17,4 +17,4 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.version = void 0;
19
19
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
20
- exports.version = '1.21.0';
20
+ exports.version = '1.21.1-alpha.1';
@@ -53,9 +53,22 @@ class TurboWebArweaveSigner extends signer_js_1.TurboDataItemAbstractSigner {
53
53
  stream: fileStream,
54
54
  size: fileSizeFactory(),
55
55
  });
56
+ let signedDataItem;
56
57
  this.logger.debug('Signing data item...');
57
- const signedDataItem = (0, arbundles_1.createData)(buffer, this.signer, dataItemOpts);
58
- await signedDataItem.sign(this.signer);
58
+ if (this.signer instanceof arbundles_1.ArconnectSigner) {
59
+ this.logger.debug('Arconnect signer detected, signing with Arconnect signData Item API...');
60
+ const sign = node_buffer_1.Buffer.from(await this.signer['signer'].signDataItem({
61
+ data: Uint8Array.from(buffer),
62
+ tags: dataItemOpts?.tags,
63
+ target: dataItemOpts?.target,
64
+ anchor: dataItemOpts?.anchor,
65
+ }));
66
+ signedDataItem = new arbundles_1.DataItem(sign);
67
+ }
68
+ else {
69
+ signedDataItem = (0, arbundles_1.createData)(Uint8Array.from(buffer), this.signer, dataItemOpts);
70
+ await signedDataItem.sign(this.signer);
71
+ }
59
72
  this.logger.debug('Successfully signed data item...');
60
73
  return {
61
74
  // while this returns a Buffer - it needs to match our return type for uploading
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '1.21.0';
17
+ export const version = '1.21.1-alpha.1';
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ArconnectSigner, ArweaveSigner, EthereumSigner, HexSolanaSigner, InjectedEthereumSigner, createData, } from '@dha-team/arbundles';
16
+ import { ArconnectSigner, ArweaveSigner, DataItem, EthereumSigner, HexSolanaSigner, InjectedEthereumSigner, createData, } from '@dha-team/arbundles';
17
17
  import { Buffer } from 'node:buffer';
18
18
  import { TurboDataItemAbstractSigner } from '../common/signer.js';
19
19
  import { readableStreamToBuffer } from '../utils/readableStream.js';
@@ -50,9 +50,22 @@ export class TurboWebArweaveSigner extends TurboDataItemAbstractSigner {
50
50
  stream: fileStream,
51
51
  size: fileSizeFactory(),
52
52
  });
53
+ let signedDataItem;
53
54
  this.logger.debug('Signing data item...');
54
- const signedDataItem = createData(buffer, this.signer, dataItemOpts);
55
- await signedDataItem.sign(this.signer);
55
+ if (this.signer instanceof ArconnectSigner) {
56
+ this.logger.debug('Arconnect signer detected, signing with Arconnect signData Item API...');
57
+ const sign = Buffer.from(await this.signer['signer'].signDataItem({
58
+ data: Uint8Array.from(buffer),
59
+ tags: dataItemOpts?.tags,
60
+ target: dataItemOpts?.target,
61
+ anchor: dataItemOpts?.anchor,
62
+ }));
63
+ signedDataItem = new DataItem(sign);
64
+ }
65
+ else {
66
+ signedDataItem = createData(Uint8Array.from(buffer), this.signer, dataItemOpts);
67
+ await signedDataItem.sign(this.signer);
68
+ }
56
69
  this.logger.debug('Successfully signed data item...');
57
70
  return {
58
71
  // while this returns a Buffer - it needs to match our return type for uploading
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "1.20.2";
16
+ export declare const version = "1.21.0";
17
17
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/web/signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EAGhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAGrB;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAE3E;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,2BAA2B;gBACxD,CAAC,E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UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAInE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ardrive/turbo-sdk",
3
- "version": "1.21.0",
3
+ "version": "1.21.1-alpha.1",
4
4
  "main": "./lib/cjs/node/index.js",
5
5
  "types": "./lib/types/node/index.d.ts",
6
6
  "module": "./lib/esm/node/index.js",