Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rss3/js-sdk

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rss3/js-sdk - npm Package Compare versions

Comparing version 0.6.47 to 0.6.48

5

lib/readable/profile/index.d.ts
import { components } from '../../types/data.js';
/**
* it will add the basic wallet address to profile as the default profile
* also sort the profile list and fix the avatar logic, the ens registrar profile will be the first
* sort the profile list and fix the avatar logic, the ens registrar profile will be the first
*/
export declare function formatProfiles(profiles: components['schemas']['Profile'][] | undefined, address: string | undefined): {
export declare function formatProfiles(profiles: components['schemas']['Profile'][] | undefined, account: string | undefined): {
action?: "create" | "update" | "renew" | "unwrap" | "wrap" | undefined;

@@ -8,0 +7,0 @@ address?: string | undefined;

26

lib/readable/profile/index.js
import { EMPTY_ADDRESS } from '../../constants.js';
import { addressToAvatarURL, formatAddress, isAddress } from '../address/index.js';
import { addressToAvatarURL } from '../address/index.js';
/**
* it will add the basic wallet address to profile as the default profile
* also sort the profile list and fix the avatar logic, the ens registrar profile will be the first
* sort the profile list and fix the avatar logic, the ens registrar profile will be the first
*/
export function formatProfiles(profiles, address) {
export function formatProfiles(profiles, account) {
if (!profiles)
return profiles;
let res = profiles || [];
// add the basic wallet address to profile
let wallet = address;
if (wallet && !isAddress(wallet)) {
wallet = res.find((item) => !!item.address)?.address;
}
if (wallet && isAddress(wallet)) {
res.push({
address: wallet,
bio: '',
handle: wallet,
name: formatAddress(wallet),
network: 'Ethereum',
platform: 'Ethereum',
profileURI: [addressToAvatarURL(wallet, 100)],
socialURI: [],
});
}
// sort the matched profile first
res = res?.sort((a) => (a?.handle === address ? -1 : 1));
res = res?.sort((a) => (a?.handle === account ? -1 : 1));
// ens registrar first

@@ -31,0 +13,0 @@ res = res?.sort((a) => (a?.platform === 'ENS Registrar' ? -1 : 1));

@@ -66,2 +66,7 @@ import { isAddress, isSupportedNS } from '../address/index.js';

: undefined;
// remove the first media, which is the avatar of the author
// this case only happens in mastodon
if (target && target.media && data.network?.toLowerCase() === 'mastodon') {
target.media = target.media.slice(1);
}
const res = {

@@ -76,3 +81,7 @@ author_url: undefined,

};
// the same as the target
if (res.media && data.network?.toLowerCase() === 'mastodon') {
res.media = res.media.slice(1);
}
return res;
}
{
"name": "@rss3/js-sdk",
"description": "RSS3 JavaScript SDK, the Turbocharger🌪️ for Your Next Open Web Development.",
"version": "0.6.47",
"version": "0.6.48",
"author": "Natural Selection Labs and RSS3 Contributors",

@@ -6,0 +6,0 @@ "license": "MIT",

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