arbase
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "arbase", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Arbase is a tool to create object-based APIs on top of arweave in mere minutes", | ||
@@ -32,3 +32,4 @@ "main": "src/index.js", | ||
"arlang": "^0.1.4", | ||
"arweave": "^1.4.1", | ||
"arql-ops": "^1.0.0", | ||
"arweave": "^1.5.3", | ||
"base-x": "^3.0.7", | ||
@@ -35,0 +36,0 @@ "protons": "^1.0.1" |
@@ -9,6 +9,11 @@ 'use strict' | ||
async function createTx (data, arweave) { | ||
return arweave.createTransaction({ | ||
async function createTx (data, arweave, rid) { | ||
const tx = await arweave.createTransaction({ | ||
data: encodeTxData(data) | ||
}, arweave.jwk) | ||
tx.addTag('i', rid) | ||
tx.rid = rid | ||
return tx | ||
} | ||
@@ -19,4 +24,3 @@ | ||
async function entryCreate (arweave, entry, tags, val) { | ||
const tx = await createTx(await validateAndEncode(entry, val), arweave) | ||
const rid = getRandomID() | ||
const tx = await createTx(await validateAndEncode(entry, val), arweave, getRandomID()) | ||
@@ -27,3 +31,2 @@ for (const tag in tags) { // eslint-disable-line guard-for-in | ||
tx.addTag('i', rid) | ||
tx.addTag('a', 'c') | ||
@@ -35,3 +38,3 @@ | ||
async function entryModify (arweave, entry, rid, tags, diff) { | ||
const tx = await createTx(await validateAndEncode(entry, diff, true), arweave) | ||
const tx = await createTx(await validateAndEncode(entry, diff, true), arweave, rid) | ||
@@ -42,3 +45,2 @@ for (const tag in tags) { // eslint-disable-line guard-for-in | ||
tx.addTag('i', rid) | ||
tx.addTag('a', 'e') | ||
@@ -50,3 +52,3 @@ | ||
async function entryDelete (arweave, entry, rid, tags) { | ||
const tx = await createTx(Buffer.from(''), arweave) // TODO: add contents | ||
const tx = await createTx(Buffer.from(''), arweave, rid) // TODO: add contents | ||
@@ -57,3 +59,2 @@ for (const tag in tags) { // eslint-disable-line guard-for-in | ||
tx.addTag('i', rid) | ||
tx.addTag('a', 'd') | ||
@@ -60,0 +61,0 @@ |
42893
7
1116
+ Addedarql-ops@^1.0.0
+ Addedarql-ops@1.0.0(transitive)
Updatedarweave@^1.5.3