Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@ic-naming/client
Advanced tools
Readme
Using npm:
npm install @dfinity/{agent,candid,principal} # dfinity dependencies
npm install @ic-naming/client
Using yarn:
yarn add @dfinity/{agent,candid,principal} # dfinity dependencies
yarn add @ic-naming/client
import { Principal } from "@dfinity/principal";
import { IcNamingClient } from "@ic-naming/client";
const client = new IcNamingClient({
net: "IC", // IC | ICP | TICP
mode: "production", // local | production
});
// get records
client.getRecordsOfName("helloworld.ic").then((records) => {
// get ICP address(principal)
const principal = records.find((r) => r[0] === "principal.icp");
console.debug(`helloworld.ic's principal is ${principal}`);
// get ICP address(account id)
const accountId = records.find((r) => r[0] === "account_id.icp");
console.debug(`helloworld.ic's account id is ${accountId}`);
// get twitter
const twitter = records.find((r) => r[0] === "com.twitter");
console.debug(`helloworld.ic's twitter is ${twitter}`);
// get eth address
const ethAdddress = records.find((r) => r[0] === "token.eth");
console.debug(`helloworld.ic's eth adddress is ${ethAdddress}`);
});
// get name's registrant
client.getRegistrantOfName("helloworld.ic").then((registrant) => {
console.debug(`helloworld.ic's registrant is ${registrant}`);
});
// get name's expired time
client.getExpiredTimeOfName("helloworld.ic").then((timestamp) => {
const expiredTime = new Date(Number(timestamp));
console.debug(`helloworld.ic's expired time is ${expiredTime}`);
});
// get reverse resolve
const thePrincipal = Principal.fromText(
"v2xhg-um7x6-mhni4-sgqsc-qarqs-bgoyy-ngobl-qoe7c-7a4cm-bvn4f-pqe"
);
client.getReverseResolve(thePrincipal).then((name) => {
if (name) console.debug(`reverse resolve name is ${name}`);
else console.debug(`reverse resolve name not exist`);
});
Special host and identity:
import { IcNamingClient } from "@ic-naming/client";
const client = new IcNamingClient({
net: "IC",
mode: "production", // local | production
httpAgent: {
host: "https://ic0.app", // default by mode
identity: {
identity: {
transformRequest: () => {
/* ... */
},
getPrincipal: () => {
/* ... */
},
},
},
},
});
https://IC-Naming.github.io/js-sdk/
Local commands:
yarn dev # rollup library watch mode
yarn type # typescript type check
yarn test # jest unit test
yarn build # rollup build to dist/
yarn release # generate new version
git tag vX.Y.Z HEAD # Create a tag started with "v" to trigger CI/CD pipeline
git push origin main --tags
FAQs
[![CI & CD](https://github.com/IC-Naming/js-sdk/actions/workflows/pipeline.yml/badge.svg)][1]
We found that @ic-naming/client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.