-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f169ca5
commit 1dda68b
Showing
5 changed files
with
57 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
const ob = require('urbit-ob') | ||
const ajs = require('azimuth-js') | ||
const {validate, eth} = require('../../utils') | ||
|
||
exports.command = 'details <point>' | ||
exports.desc = 'Outputs various information about a <point>. Such as owner and proxy addresses.' | ||
exports.builder = (yargs) =>{ | ||
} | ||
|
||
exports.handler = async function (argv) { | ||
const ctx = await eth.createContext(argv); | ||
const p = validate.point(argv.point, true); | ||
const patp = ob.patp(p); | ||
console.log(`urbit ID (patp): ${patp}`); | ||
console.log(`urbit ID number (p): ${p}`); | ||
|
||
const shipType = ob.clan(patp); | ||
console.log(`ship type: ${shipType}`); | ||
|
||
const parentPatp = ob.sein(patp); | ||
const parentP = ob.patp2dec(parentPatp); | ||
console.log(`parent: ${parentPatp}`); | ||
|
||
const sponsorP = await ajs.azimuth.getSponsor(ctx.contracts, p); | ||
const sponsorPatp = ob.patp(sponsorP); | ||
const hasSponsor = await ajs.azimuth.hasSponsor(ctx.contracts, p); | ||
console.log(`sponsor: ${hasSponsor ? sponsorPatp : 'null'}`); | ||
|
||
const ownerAddress = sanitizeAddress(await ajs.azimuth.getOwner(ctx.contracts, p)); | ||
console.log(`owner address: ${ownerAddress}`); | ||
|
||
const spawnProxyAddress = sanitizeAddress(await ajs.azimuth.getSpawnProxy(ctx.contracts, p)); | ||
console.log(`spawn proxy address: ${spawnProxyAddress}`); | ||
|
||
const networkKeysSet = await ajs.azimuth.hasBeenLinked(ctx.contracts, p); | ||
console.log(`network keys set: ${networkKeysSet}`); | ||
const networkKeysRevision = await ajs.azimuth.getKeyRevisionNumber(ctx.contracts, p); | ||
console.log(`network keys revision: ${networkKeysRevision}`); | ||
|
||
const continuityNumber = await ajs.azimuth.getContinuityNumber(ctx.contracts, p); | ||
console.log(`continuity number: ${continuityNumber}`); | ||
|
||
const spawnedChildrenCount = await ajs.azimuth.getSpawnCount(ctx.contracts, p); | ||
console.log(`spawned children: ${spawnedChildrenCount}`); | ||
} | ||
|
||
function sanitizeAddress(address){ | ||
if(address && !ajs.utils.addressEquals('0x0000000000000000000000000000000000000000', address)){ | ||
return address.toLowerCase(); | ||
} | ||
return null; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters