@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.
- package/bundles/web.bundle.min.js +55 -55
- package/lib/cjs/utils/ao.js +14 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/utils/ao.js +15 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/utils/ao.js
CHANGED
|
@@ -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,
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/utils/ao.js
CHANGED
|
@@ -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,
|
package/lib/esm/version.js
CHANGED
package/lib/types/version.d.ts
CHANGED