@ar.io/sdk 3.3.0-alpha.8 → 3.3.0-alpha.9

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.
@@ -153,6 +153,20 @@ function createAoSigner(signer) {
153
153
  typeof signer.setPublicKey === 'function') {
154
154
  await signer.setPublicKey();
155
155
  }
156
+ if (signer instanceof arbundles_1.ArconnectSigner) {
157
+ // Sign using Arconnect signDataItem API
158
+ const signedDataItem = await signer['signer'].signDataItem({
159
+ data,
160
+ tags,
161
+ target,
162
+ anchor,
163
+ });
164
+ const dataItem = new arbundles_1.DataItem(Buffer.from(signedDataItem));
165
+ return {
166
+ id: await dataItem.id,
167
+ raw: await dataItem.getRaw(),
168
+ };
169
+ }
156
170
  const dataItem = (0, arbundles_1.createData)(data, signer, { tags, target, anchor });
157
171
  const signedData = dataItem.sign(signer).then(async () => ({
158
172
  id: await dataItem.id,
@@ -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 = '3.3.0-alpha.8';
20
+ exports.version = '3.3.0-alpha.9';
@@ -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 { createData } from '@dha-team/arbundles';
16
+ import { ArconnectSigner, DataItem, createData } from '@dha-team/arbundles';
17
17
  import { connect, createDataItemSigner } from '@permaweb/aoconnect';
18
18
  import { z } from 'zod';
19
19
  import { defaultArweave } from '../common/arweave.js';
@@ -147,6 +147,20 @@ export function createAoSigner(signer) {
147
147
  typeof signer.setPublicKey === 'function') {
148
148
  await signer.setPublicKey();
149
149
  }
150
+ if (signer instanceof ArconnectSigner) {
151
+ // Sign using Arconnect signDataItem API
152
+ const signedDataItem = await signer['signer'].signDataItem({
153
+ data,
154
+ tags,
155
+ target,
156
+ anchor,
157
+ });
158
+ const dataItem = new DataItem(Buffer.from(signedDataItem));
159
+ return {
160
+ id: await dataItem.id,
161
+ raw: await dataItem.getRaw(),
162
+ };
163
+ }
150
164
  const dataItem = createData(data, signer, { tags, target, anchor });
151
165
  const signedData = dataItem.sign(signer).then(async () => ({
152
166
  id: await dataItem.id,
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '3.3.0-alpha.8';
17
+ export const version = '3.3.0-alpha.9';
@@ -13,4 +13,4 @@
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 = "3.3.0-alpha.7";
16
+ export declare const version = "3.3.0-alpha.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.3.0-alpha.8",
3
+ "version": "3.3.0-alpha.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"