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)

b958090e...8fdfc3de

830,923

Activity

TypeFromToTxDate
Transfer
bc1pwzt5...msmx2dukbc1pe8ls...8szwjn8s4f0156a2...8b10b1cdMar 12, 2024, 3:56 PM
Transfer
bc1psc69...ssjnj86mbc1pwzt5...msmx2duk2952299f...1e04f06fMar 12, 2024, 3:56 PM
Inscribed
bc1psc69...ssjnj86mb958090e...8fdfc3deFeb 17, 2024, 11:29 PM