New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arweave-id

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arweave-id - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

build/src/v1claimed.d.ts

20

build/src/arweaveID.js

@@ -10,2 +10,4 @@ "use strict";

const toUint8Array = require('base64-to-uint8array');
const xss_1 = require("xss");
const v1claimed_1 = __importDefault(require("./v1claimed"));
/**

@@ -43,9 +45,9 @@ * Function to get an ArweaveId object for the supplied arweave address.

case 'Name':
id.name = tag['value'];
id.name = xss_1.filterXSS(tag['value']);
break;
case 'Url':
id.url = tag['value'];
id.url = xss_1.filterXSS(tag['value']);
break;
case 'Text':
id.text = tag['value'];
id.text = xss_1.filterXSS(tag['value']);
break;

@@ -124,8 +126,8 @@ case 'Content-Type':

transaction.addTag('App-Version', '0.0.2');
transaction.addTag('Name', arweaveIdData.name.trim());
transaction.addTag('Name', xss_1.filterXSS(arweaveIdData.name.trim()));
if ((arweaveIdData.text !== undefined) && (arweaveIdData.text !== '')) {
transaction.addTag('Text', arweaveIdData.text);
transaction.addTag('Text', xss_1.filterXSS(arweaveIdData.text));
}
if ((arweaveIdData.url !== undefined) && (arweaveIdData.url !== '')) {
transaction.addTag('Url', arweaveIdData.url);
transaction.addTag('Url', xss_1.filterXSS(arweaveIdData.url));
}

@@ -148,3 +150,7 @@ mediaType.length === 0 ? mediaType = 'none' : transaction.addTag('Content-Type', mediaType);

async function check(name, arweaveInstance) {
const query = `query { transactions(tags: [{name:"App-Name", value:"arweave-id"}, {name:"Name", value:"${name}"}]) {id tags{name value}}}`;
let _name = xss_1.filterXSS(name);
if (v1claimed_1.default[_name] !== undefined) {
return v1claimed_1.default[_name];
}
const query = `query { transactions(tags: [{name:"App-Name", value:"arweave-id"}, {name:"Name", value:"${_name}"}]) {id tags{name value}}}`;
let res = await arweaveInstance.api.post('arql', { query: query });

@@ -151,0 +157,0 @@ let arweaveIDTxns = res.data.data.transactions; // Gets all transactions that claim 'arweaveID'

{
"name": "arweave-id",
"version": "2.0.3",
"version": "2.0.4",
"description": "",

@@ -36,4 +36,5 @@ "main": "build/src/index.js",

"identicon.js": "^2.3.3",
"jshashes": "^1.0.8"
"jshashes": "^1.0.8",
"xss": "^1.0.7"
}
}

@@ -11,2 +11,5 @@ # arweave-id Version 2

## Basic Usage
Install using `npm install arweave-id` then do
```javascript

@@ -36,2 +39,3 @@ import Arweave from 'arweave/web'

`get(address: string, arweaveInstance: Arweave): Promise<ArweaveId>`
Looks up the ArweaveID associated with a given Arweave address and returns all available data elements

@@ -48,2 +52,3 @@

`set(arweaveIdData: ArweaveId, jwk: JWKInterface, arweaveInstance: Arweave ): Promise<ISetReturn>`
Creates, signs, and submits an arweave-id transaction claiming ownership of the ArweaveId provided.

@@ -64,2 +69,3 @@

`check(name: string, arweaveInstance: IArweave): Promise<string>`
Look up an arweave-id name to see if it's available, returns an empty string `''` or the owners address.

@@ -76,2 +82,3 @@

`getIdenticon(name: string): string`
This function is provided as a method of generating an avatar for the user. Example usage, when the optional avatar has not been set.

@@ -78,0 +85,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc