text/javascript
/*🇿ed's Recursor v0 */ export class ZedRecursorV0 { /*query*/ async query(param) { const search = new URLSearchParams(window.location.search); return search.get(param); } /*recur*/ async recur(dir, id, p = 0, json = []) { const response = await fetch(`/r/${dir}/${id}/${p}`); const data = await response.json(); json = json.concat(data.ids); return data.more ? this.recur(dir, id, p + 1, json) : json; } /*meta*/ async meta(id) { const response = await fetch(`/r/metadata/${id}`); const json = await response.json(); const bytes = new Uint8Array( json.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)) ); return CBOR.decode(bytes.buffer); } /*metaArray*/ async metaArray(ids) { const promises = ids.map(async (id) => ({ [id]: await this.meta(id) })); const meta = await Promise.all(promises); return meta.reduce((acc, current) => { return { ...acc, ...current }; }, {}); } }
Share this inscription:
Inscription #61,009,002
Parent inscription
#155,057
PNG
Inscription info
816 bytes
Feb 17, 2024, 11:29 PM(1 year ago)
Activity
Type | From | To | Tx | Date |
---|---|---|---|---|
Transfer | bc1pwzt5...msmx2duk | bc1pe8ls...8szwjn8s | 4f0156a2...8b10b1cd | Mar 12, 2024, 3:56 PM |
Transfer | bc1psc69...ssjnj86m | bc1pwzt5...msmx2duk | 2952299f...1e04f06f | Mar 12, 2024, 3:56 PM |
Inscribed | bc1psc69...ssjnj86m | b958090e...8fdfc3de | Feb 17, 2024, 11:29 PM |