https://github.com/urbit/aura-js
An NPM package for working with urbit atoms. Only @da supported for now
https://github.com/urbit/aura-js
Last synced: 3 months ago
JSON representation
An NPM package for working with urbit atoms. Only @da supported for now
- Host: GitHub
- URL: https://github.com/urbit/aura-js
- Owner: urbit
- License: mit
- Created: 2022-05-02T18:56:24.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T16:36:30.000Z (about 1 year ago)
- Last Synced: 2025-03-24T14:21:24.746Z (4 months ago)
- Language: TypeScript
- Size: 792 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `@urbit/aura`
This NPM package is intended to ease the flow of developing FE applications for urbit, by adding parsing and formatting functions for the various urbit auras
## API
```typescript
// @da manipulation
function parseDa(da: string): bigint;
function formatDa(da: bigint): string;
// Given a bigint representing an urbit date, returns a unix timestamp.
function daToUnix(da: bigint): number;
// Given a unix timestamp, returns a bigint representing an urbit date
function unixToDa(unix: number): bigint;// @p manipulation
// Convert a number to a @p-encoded string.
function patp(arg: string | number | bigint): string;
function hex2patp(hex: string): string;
function patp2hex(name: string): string;
function patp2bn(name: string): bigint;
function patp2dec(name: string): string;
// Determine the ship class of a @p value.
function clan(who: string): string;
// Determine the parent of a @p value.
function sein(name: string): strin;
// Validate a @p string.
function isValidPatp(str: string): boolean;
// Ensure @p is sigged.
function preSig(ship: string): string;
// Remove sig from @p
function deSig(ship: string): string;
// Trim @p to short form
function cite(ship: string): string | null;// @q manipulation
// Convert a number to a @q-encoded string.
function patq(arg: string | number | bigint): string;
function hex2patq(arg: string): string;
function patq2hex(name: string): string;
function patq2bn(name: string): bigint;
function patq2dec(name: string): string;
// Validate a @q string.
function isValidPatq(str: string): boolean;
// Equality comparison on @q values.
function eqPatq(p: string, q: string): boolean;// @ud manipulation
function parseUd(ud: string): bigint;
function formatUd(ud: bigint): string;// @uv manipulation
function parseUv(x: string): bigint;
function formatUv(x: bigint | string): string;// @uw manipulation
function parseUw(x: string): bigint;
function formatUw(x: bigint | string): string;// @ux manipulation
function parseUx(ux: string): string;
function formatUx(hex: string): string;
``;
```