-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnamespace.js
More file actions
executable file
·43 lines (41 loc) · 1.54 KB
/
namespace.js
File metadata and controls
executable file
·43 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {Record} from '@resolverworks/enson';
import {createNamespace} from '../src/namespace.js';
import cb from './coinbase.js';
import wiki from './wikipedia.js';
import unicode from './unicode.js';
import mirror from './mirror.js';
import emoji from './emoji.js';
export default createNamespace('namespace', { // endpoint
'raffy.eth': { // the name I want to describe
'.': { // record for the parent name
name: 'Raffy',
description: 'p ^ ~p',
location() { return new Date().toLocaleString(undefined, {timeZone: 'PST'}); }, // inline dynamic record
},
unicode, emoji, wiki, cb, // imported routers as "x.raffy.eth"
moo: { // static records for "moo.raffy.eth"
name: 'Good Morning Cafe Moo #331',
avatar: 'https://gmcafe.s3.us-east-2.amazonaws.com/gmoo/original/331.png',
url: 'https://www.gmcafe.io/moo/331'
},
async chonk(s) { // this is a subdomain that fetchs nft data
if (s) return; // only allow "chonk.raffy.eth"
//let record = await mirror.resolve('chonk239.nft-owner.eth');
let record = Record.from(await mirror.resolve('chonk239.nft-owner.eth')); // fetch through NFT Resolver
record.setText('avatar', 'https://chonksociety.s3.us-east-2.amazonaws.com/images/239.png'); // patch the avatar
return record;
},
debug(name, context) {
return Record.from({
name,
location: new Date().toISOString(),
description: `Namespace: ${context.space.name}\nBasename: ${context.base.name}`
});
},
tog: 'multi'
},
'slobo.eth': {
name: 'Alex',
$eth: '0x534631Bcf33BDb069fB20A93d2fdb9e4D4dD42CF',
}
});