@li0ard/ons
v0.1.1
Published
Oxen Name System resolver for TypeScript
Readme
[!WARNING]
Argon2-based ONS's are deprecated since this commit (Support for these ONS's has been removed from Session clients)
Features
- Supports current (Blake2B) and legacy (Argon2ID) formats
- Works in browser, Cloudflare Workers and server (Node/Deno/Bun)
- Cryptographic libraries are written in pure JS (except Argon2ID)
Installation
# from NPM
npm i @li0ard/ons
# from JSR
bunx jsr i @li0ard/onsExamples
Resolve ONS
import { resolve, OnsTypes } from "@li0ard/ons"
console.log(await resolve("li0ard")) // -> Session ID
console.log(await resolve("jagerman", OnsTypes.WALLET)) // -> Wallet address
console.log(await resolve("li0ard", OnsTypes.LOKINET)) // -> Lokinet addressRetrieve information from blockchain
import { infoByName, OnsTypes } from "@li0ard/ons"
console.log(await infoByName("li0ard"))
console.log(await infoByName("jagerman", OnsTypes.WALLET))
console.log(await infoByName("li0ard", OnsTypes.LOKINET))Retrieve ONS's linked to wallet
import { infoByOwners } from "@li0ard/ons"
console.log(await infoByOwners([
"L6JasonXTGW6juHrJgsXTxXH1Jh9u94H8NQ9m4rMwz5a9SZGr2e1cXw9MqnVH6Qx5bTgL5wf7qfvHeNPdwyC63AzMixU5ad"
])) // [...]